Convert image to icon using IcoFX

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?

{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?

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

No, I definitely want to capture the actual file. Image HERE I used from the DOpus built-in convert method.

This created an actual myicofxscript.fxs file in the directory, but did not convert the file.

You want to convert the selected file? Then change the second line:

echo {filepath} >> myicoscript.fxs

This works! Only issue is both IcoFX and its Batch Process dialog stay open. How would I close that automatically?

I noticed this too... maybe the script needs a close statement?

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