Bonzo wrote:I like to have batch files and think they are useful as you can have a standard program you can tweek and just drag and drop files over the batch file icon to modify.
Nothing to do with GUI. BUT....
IMv7 will have batch file capability. That is reading image processing options from a file.
I have even looked at methods to have a DOS ".bat" file convert from DOS to ImageMagick Script. That way you don't need to create another suffix for Magick Scripts. It is similar to one of the UNIX techniques.
This is the header of a ImageMagick 'batch' script, though it is not tested with the current IMv7. But it should (hopefully) work.
Code: Select all
@echo This line is DOS executed but ignored by Magick
@magick -script %~dpnx0 %*
@GOTO :EOF
#
# The rest of the file is magick script
-read label:"This is a Magick Script!"
-write label.png
-exit
Under UNIX Shell you can do the following (this has been tested)
Code: Select all
#!/bin/sh
@() { exec magick -script "$@"; }
@ "$0" "$@"; exit
#
# The rest of the file is magick script
-read label:"This is a Magick Script!"
-write show: -exit
Of course the other UNIX scripting methods work too.
The second one needs 'magick-script' to be linked to the "magick" command.
The script contents are basically parsed much like BASH does for Quoting, escapes, and line continuation. But not using shell variables or backquotes. The use of '\' at the end of the line (outside a quoted arguement) is optional but handled exactly as BASH shell.
The -exit at the end is new, and optional. It basically stops IM reading the script any further. It also works from IMv7 command line when you don't want a final 'implict write' of the images in memory.
As such you should be able to cut an paste the arguments from a UNIX command line, and put it into the script and have it work as before. With the exception that you must use -write for the final save of image results when processing from a script.
What is missing.... Script argument handling!!!
But that is coming too. After I get global Percent Escapes finished (it is working for operator options but not setting options).