Hi guys, a little help here is very much appreciated.
Fred has been helping me with a script to create transparent PNGs from EPS with paths.
Which eventually contributed to a dot version upgrade to IM.
Well, we've successfully run the script one at a time however I need a little help with running it on all the files on a network location.
I have IM installed on my machine however every file is on a network location.
I can't seem to get the script written correctly to actually run and process all the files.
This is the working script that I can run one at a time.
convert -density 300 -profile C:\ImageMagick-6.9.8-Q16\sRGB.icc \path\to\my\file.eps -alpha transparent -clip -alpha opaque -strip \path\to\my\results\file.png
How do I write this so that I can run all EPS files in drive "M" and output to a subfolder "PNG-files" ?
This doesn't work for me:
FOR %a in (*.eps) DO convert -density 300 -profile \test-Trans-png-copy-job\sRGB.icc %a -alpha transparent -clip -alpha opaque -strip -path \PNG-files %a.png
thanks in advance
Help with command line script - newb
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Help with command line script - newb
If you're trying to run that from a BAT script you'll need to make all those single percent signs "%" into doubles "%%".
Also, to get wildcard filenames to work you need to be running the script in the directory with the files. You can have your script change to that directory using "pushd" before the working commands.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Help with command line script - newb
"-path" isn't an option for "convert". The output filename itself can contain a path.LorenzoM wrote:FOR %a in (*.eps) DO convert -density 300 -profile \test-Trans-png-copy-job\sRGB.icc %a -alpha transparent -clip -alpha opaque -strip -path \PNG-files %a.png
If an input file is named "abc.eps", you will get an output file "abc.eps.png". You might prefer "abc.png", in which case you need to "%~na.png". See "help for".
snibgo's IM pages: im.snibgo.com