11. Scripting. Esko Automation Engine
Реклама
Реклама
Automation Engine
11
11. Scripting
You can write Scripts (small programs) to automate the execution of certain tasks during a workflow.
Writing and using such scripts is called scripting. You need the Script Runner application to link scripting with your Automation Engine workflows. You can automate actions from Adobe applications
(e.g. Illustrator, Photoshop, InDesign) and third party tools (e.g. Alwan) using Scripts.
Some of the instances where scripting is useful are given below:
• to ensure file format integrity (standardization) for workflow inputs.
• to use standardized PDF as input during the Preflight process.
• to automate Adobe Illustrator, Photoshop, InDesign and InDesign Server via ExtendScript on Mac
Os and Windows.
Supported Script Types
• AppleScript (on Mac OS)
• ShellScript (on Mac OS)
• Batch files (on Windows)
• Windows Script (VBScript, JScript) (on Windows)
• ExtendScript (on Mac OS and Windows)
More info on Scripting :
Getting Started with Scripting
More info on Scripting in workflows:
Use case: Scripting
11.1 Automation Engine Script Runner
The Automation Engine(AE) Script Runner is a standalone AE server component which runs scripts on behalf of AE. You can add customization to your workflow by adding a Run Script task. This task will run on the Automation Engine server while the execution of the script will be done on the
Script Runner application which can be installed on Windows or Macintosh. When you launch the workflow, the following will take place:
177
11
Automation Engine
1. The Run Script task sends a request to run the specified script.
2. The Script Runner processes the request accordingly and runs the script.
3. The Script Runner sends the results back to the server.
4. The workflow will continue with the outputs from this task.
11.2 Getting Started with Scripting
Scripting helps you customize some steps in your work flows. You can achieve this by adding a Run
Script task to the work flow where you want customization. The Automation Engine will use Script
Runner to run scripts which are stored either locally or on a server. When you launch the workflow in
Automation Engine, the Script Runner runs the script which contains the main function incorporating the inputs from the Run Script task, output folder and some optional script parameters from the Run
Script ticket. The workflow in Automation Engine continues with the contents of the output folder which contains the outputs from the script. To achieve this, you need to do the following steps :
1. Download Automation Engine Script runner. You can download it via the web access to the
Automation Engine Server. Client Apps > Tools .
178
Automation Engine
11
• On Mac OS, open the ‘dmg’ file after downloading the Script Runner which contains the installer package. Double-click to start the installation.
• On Windows, double-click the downloaded installer to start the installation.
2. Install the Script Runner by following the instructions in the Installshield Wizard/Assistant and make sure it is running in your computer.
• On Windows, open Start > All Programs > Esko > Automation Engine Script Runner >
Preferences .
• On Mac OS, open Applications > Automation Engine Script Runner > Esko > Automation
Engine Script Runner > Script Runner Preferences .
In the Script Runner Preferences window, you can:
• check if the Script Runner is actually running
• start / stop the Script Runner
• enable(disable) Start at login
• view and change the port the Script Runner is communicating with
• view and change the default folders for scripts
179
11
Automation Engine
3. Configure the Script Runner on your computer. Read more in
Scripts
.
4. Write and save scripts. You can find sample scripts in the subfolders of /Library/Scripts/Esko on
Mac OS and C:\Esko\bg_data_fastserverscrrunnt_v100\Scripts on Windows.
• You can store the scripts on your computer on a default folder(specific for script type). This is ideal when you are developing and testing a script or when you do not intend to give access to other Script Runners on the network.
Note: The default location : on Mac OS : /Library/Scripts/Esko.
on Windows : C:\Esko\bg_data_fastserverscrrunnt_v100\Scripts.
Automation Engine does not back up these scripts.
• Alternatively, you can store your scripts in the Automation Engine data folder. This option is suitable when you want to make your scripts available to all configured Script Runners.
Note: The default location :
C:\Esko\bg_data_fastserver_v100\Scripts.
Automation Engine backs up these scripts.
5. Run the Script using Run Script task in a workflow. Read more about this in
Run Script
.
Note: Refer to the Reference Guide for more on Scripting
11.3 Use case: Scripting
Note:
Sample scripts are solely intended to demonstrate techniques for accomplishing common tasks.
Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
It is up to the user to verify that his intended use of the offered automation functionality is compliant with any third party license agreement and/or other restrictions applicable to any non-Esko products.
180
Automation Engine
11
Please read
Getting Started with Scripting
before conducting the steps below.
In this example, we are demonstrating a script which will perform a Photoshop action and produce a JPEG output. The script 'EskoPSDoActionAndSaveasJPG.jsx' is available from the sample scripts subfolder (ExtendScript) in /Library/Scripts/Esko on Mac or C:\Esko
\bg_data_fastserverscrrunnt_v100\Scripts on Windows.
1. You have to save the Set and Action in Photoshop . In this example we are using Default Actions as Set and Molten Lead as Action.
2. You can open the script with ExtendScript Toolkit to edit the script if required. However, in this sample, we do not need to edit the script.
3. Edit the settings of the Run Script task as follows:
181
11
Automation Engine
182 a) Run on: is the name of the computer where your Automation Engine ScriptRunner is installed.
The name in this example is
ShaletMac
. You can read more about configuring and naming
Script Runner in
Scripts
b) Script Type: choose
ExtendScript
.
c) Script File: choose
EskoPSDoActionAndSaveasJPG.jsx
.
d) Script Parameters: Add the name of your Photoshop Action name followed by your Set . In this example,
Molten Lead
;
Default Actions e) Save the task.
4. Launch the task: a) Select the Photoshop file.
b) Right-click the file and browse for the ticket.
c) Click Launch.
You will see that while the script starts to run on the Automation Engine Server, PhotoShop opens, performs the actions, closes and continues the script. The result of this sample script is finally an adjusted jpeg.
Завантажити
Реклама