Using Scripts and Actions in uImage Calls
Scripts
In the document package (uImage.uImage call), the script usage is fully defined in the Package, so there is no need to define it in the uImage call.
You can automate a set of design operations using a script (JavaScript file). For example, your design may require rasterizing layers, but uImage can only personalize non-rasterized layers. To solve this problem, you can first use uImage to personalize the layers, and then run a script that rasterizes these layers and completes the design.
To enable uImage to run your script, the uImage call must specify the full path to your JavaScript file, using the SCR parameter. The tag names and values are automatically passed to the script.
The following is an explanation on how the script uses the tag names and values that are passed by the uImage call.
Using uImage tags in Scripts
The uImage call passes the tag names and values
to the script (this is optional for the uImage.uImage
call and takes place automatically for other calls).
This feature allows you to use your script in different ways, depending
on the recipient values. For example, you can create different design
effects for members of different clubs.
To obtain the tag names and values, use the arguments [] parameter.
For example: arguments[0] references “Tag name 1”, arguments[1] references “Tag value 1”, arguments[2] references “Tag name 2”, arguments[3] references “Tag value 2”etc.
For example, a template may include two tags: “FirstName” and “LastName”. This template may be used to create personalized images for two recipients: Jane Jones and Sam Smith.
When creating a personalized image for the first recipient, Jane Jones, the script uses the arguments parameter as follows:
-
arguments[0] value is “FirstName”
-
arguments[1] value is “Jane”
-
arguments[2] value is “LastName”
-
arguments[3] value is “Jones”
When creating a personalized image for the second recipient, Sam Smith, the script uses the arguments parameter as follows:
-
arguments[0] value is “FirstName”
-
arguments[1] value is “Sam”
-
arguments[2] value is “LastName”
-
arguments[3] value is “Smith”
Actions
Actions, like scripts, are used to automate a set of design operations. To enable uImage to use an action, the uImage call must specify the name of the action folder and the name of the action.
Note: Actions are supported only by uImage for Photoshop.
For example, the Photoshop Actions panel includes an action folder (Set) named Simple Math-NEW, which contains an action named Simple Math- High Res.
The uImage call defines this action as follows:
"ACN=Simple Math NEW\\Simple Math - HighRes"