Macros in Photo Supreme
Script Macros
Photo Supreme supports two types of Macro Commands: standard macros and script macros. Standard macros were explained in the previous chapter. In addition to these, there are script macros, which consist of a piece of script code enclosed in a %code %/code block. For example:
%code result := ‘Hello World’; %/code
Everything inside the leading %code and trailing %/code block will be considered script code and executed as such. Within these scripts, you can utilize the script variable ImageItem to access the properties of the image being parsed. This allows for dynamic manipulation and retrieval of various attributes associated with the image, enabling more complex operations and customizations in your workflow.
%code result := ImageItem.FileName; %/code
A script can be as long and complex as you like, which makes script macros powerful tools for returning a wide range of outputs and functionalities. However, the downside is that you need to learn the scripting language, which is based on Object Pascal. This learning curve can be significant, but it offers flexibility to create custom solutions tailored to your specific needs in Photo Supreme. By mastering the scripting language, you can unlock advanced capabilities that go beyond standard macro commands, enabling you to automate tasks and manipulate data in sophisticated ways.