Here's an example script that shows a dialog with a "Preserve timestamps" checkbox, and then runs a command with the -p flag added if the checkbox was turned on. Currently it just prints a command line to a DOS prompt - you'll need to take out the echo
command and set the path of the jpegoptim
command as necessary (as well as add any other options you want).
If you select one or more files and click the button, you'll see the command line printed once for each selected file.
Dialog Example.dcf (2.5 KB)
(see How to use buttons and scripts from this forum for instructions on how to use the .dcf file).