Scripting

Top  Previous  Next

 

clip0455

 

Open the Scripting panel to get access to a very powerful feature of the Downloader: Scripting. You have the option to run 3 types of scripts: pre-processing scripts, post-processing scripts and one or more handler scripts.

 

They differ in the moment they will be executed by the download engine:

 

Pre-processing Script

will be executed as the first step in the download process, so even before any of your source images have been transferred

 

Post-processing script

will be executed at the end of the download process, so after copying, processing, cataloging, versioning, etc... of all marked images is finalized

 

Handler scripts

You have the option to select or create multiple handler scripts. They will be executed sequentially for each of the marked images and will take care of the image copying process.

 

 

 

 

Tip!

The script engine in the Downloader uses Object Pascal (Delphi) as its programming language. Here is a short reference on this language's syntax: http://www.marcocantu.com/epascal/

For all who are not Delphi specialists, this site (with an "Run Time Library Reference") may also be very helpful: http://www.delphibasics.co.uk/index.html

The Downloader uses several object classes and libraries that are specific to IDimager. The published routines, methods and classes are listed in this document: http://www.idimager.com/support/scripts/IDimager.chm

Note: If you're using Windows XP and the above help file does not work after downloading... Right click on the downloaded file, go to Properties panel, and click the "Allow" button in the lower right corner. For Vista, the button is called "Unlock".

Retrieved from "http://wiki.idimager.com/index.php?title=Developer%27s_Reference"

 

 

Pre-processing script

 

If you want to run a pre-processing script, mark the check box Run pre processing script.

Open the drop-down and select the option Select script file... By default the Downloader uses the file extension .idscript for Pre- and Post processing scripts.

 

clip0456

 

You can edit the script itself by clicking on the button to the right of the drop-down (marked red in the image above). If your script file expects parameters, enter them by click on the right-most button. In that dialog you simply add parameter name and value:

 

 

 

Post Processing script

 

Similar to the pre-processing script. Open the drop-down and select the option Select script file... By default the Downloader uses the file extension .idscript for Pre- and Post processing scripts.

Edit the script itself by clicking on the button to the right of the drop-down and if required enter your parameter values by clicking on this button

 

Handler scripts

 

Copy handlers are especially useful when you want to do some action with the marked image(s) before the file is transferred. It could be you want a series folders to be create first or that you want to do some conversion before downloading the file. Have a look at the article Using the DNG downloader script.

 

If you want to use handler scripts to copy your images, activate the check box Use handler script to copy the images. The table below it will now be active. Initially one handler script will be loaded in the table and that is the { Default Copy Handler } script. If you hover with the mouse over the name, the complete filename including path will show.

 

clip0457

 

To open an existing copy handler, click on the open folder button in the table. By default the file filter will be *.pch since that is the extension that IDimager uses for copy handler files.

 

To create a new copy handler, press the second button. This will open the script panel as shown below:

 

 

When you are finished with your script and have compiled it without any errors, you can save it to a file. When you close the script panel, the name of the newly created copy handler script will appear in the table.

 

If your scripts expects parameters, enter the name and values in the table that you access via the button.

 

If you want to remove a handler script from the list, you can do that by pressing this button