For example, try the following simple script:
On a single image, it will print the background of the image.
When used inside the Apply Script Window it will produce the following output:
Now add the ApplyScript.First and .Last commands, this is the script and the result:
Code: Select all
stats = "" if ApplyScript.First then stats = "First" if ApplyScript.Last then stats = "Last" print Round(Image.Background) ; stats
The .First could be used to initialize some calculations, for example some reference from the first image.
A last example with the .Index and .Count commands:
When these commands (.Count and .Index) are used in a standalone script (so without the ApplyScript window) they return 0 / 0. This can be used to define a behaviour when the script is used on a single image.