Chuck
March 10, 2019, 7:28pm
1
I want to create a button to convert an image to an icon using scripting and IcoFX, similar to what DOpus natively uses to convert images from one format to another. Here's the IcoFX script :
/ convert all png files from the images folder to icons using sharpening
create
"C:\images\*.png"
-sharpen 2
-output C:\icons\
My DOpus button looks like this:
Image HERE ""C:\Program Files (x86)\icofx3\icofx3.exe" create {sourcepath}.png -sharpen 2 -output {sourcepath}"
It does not do anything. What am I missing?
Leo
March 10, 2019, 7:52pm
2
{sourcepath}
inserts the current directory path. It doesn't insert the selected file names or paths. If that what you want there?
Is the Image HERE
at the start of that line meant to be there?
lxp
March 10, 2019, 8:00pm
3
IcoFX wants its own script on the command line. You need a DOS button like this:
echo create > myicoscript.fxs
echo {sourcepath}*.png >> myicoscript.fxs
echo -sharpen 2 >> myicoscript.fxs
echo -output {sourcepath} >> myicoscript.fxs
"C:\Program Files (x86)\icofx3\icofx3.exe" myicoscript.fxs
Chuck
March 10, 2019, 8:35pm
4
No, I definitely want to capture the actual file. Image HERE I used from the DOpus built-in convert method.
Chuck
March 10, 2019, 8:36pm
5
This created an actual myicofxscript.fxs file in the directory, but did not convert the file.
lxp
March 10, 2019, 8:43pm
6
You want to convert the selected file? Then change the second line:
echo {filepath} >> myicoscript.fxs
Chuck
March 10, 2019, 8:48pm
7
This works! Only issue is both IcoFX and its Batch Process dialog stay open. How would I close that automatically?
lxp
March 10, 2019, 8:53pm
8
I noticed this too... maybe the script needs a close statement?
Chuck
March 10, 2019, 9:01pm
9
It works with this:
echo create > myicoscript.fxs
echo "{filepath}" >> myicoscript.fxs
echo -sharpen 2 >> myicoscript.fxs
echo -output {sourcepath} >> myicoscript.fxs
echo terminate >> myicoscript.fxs
"C:\Program Files (x86)\icofx3\icofx3.exe" myicoscript.fxs
Need to solve an access violation for IcoFX.exe at the end, but otherwise works.
Thanks Ixp!
1 Like