Event scripts in InDesign and InCopy can be used to automatically perform specific actions when an event takes place.
Examples:
|
Note: Event scripts can be found on the Help Center.
To help in the deployment and management of event scripts, system administrators can automatically deploy them from Enterprise Server to InDesign, InCopy or InDesign Server (either to each application separately or to a combination of these applications).
In short, it works as follows:
- The scripts that need to be deployed are placed on Enterprise Server in a Server plug-in.
- An Access Right is enabled for those user groups to which the scripts should be deployed.
- The user logs in and the scripts are automatically installed, updated, or removed on the local system.
Default installation
A default plug-in and Access Right are shipped with Enterprise Server; both named "Enterprise Scripts". A set of dummy event scripts are provided with the plug-in which can be modified or replaced as needed.
Note: The Access Right is disabled by default so no scripts will be unknowingly deployed.
When different deployments are needed (such as deploying different sets of scripts to different user groups), multiple instances of the plug-in can be installed and configured.
Creating the scripts
The scripts that can be deployed should all be event scripts: scripts that are triggered when an event takes place. Such scripts are invisible to the end user and can be used to run background tasks.
For more information about event scripts for Smart Connection, see the Smart Connection Scripting and Events Guide.
Note: When creating a compressed file on Mac OS X, additional files and folders are automatically included such as a '_MACOSX' folder, and/or a .DS_Store file. For tips about how to resolve this, see Google Search. |
Configuring the default plug-in
In the following steps, the default plug-in is used. With this scenario you will:
- Deploy one file per client
- Have one Access Right to define to which user groups the scripts should be deployed
Note: You can create a single file to deploy to all 3 clients or create multiple files to deploy to separate clients.
Examples:
|
1. Placing the scripts in the plug-in
Step 1. Create one or more zipped files containing the scripts that need to be deployed and place them in the SubApplication folder of the Server plug-in:
<Enterprise Server path>/Enterprise/server/plugins/EnterpriseScripts/SubApplication
Tip: As an alternative method, place the ZIP file in a central location such as the file system. The advantage of a central location is that the ZIP file is not touched when upgrading Enterprise Server. The default server plug-in contains code to provide the ZIP file from the _SYSTEM_ folder in the file store to the clients that request the Enterprise Scripts. The code is commented out by default, but it can be activated easily. Show me the code
Look for "'$subApp->PackageURL" in the file named "Enterprise_Scripts_SysGetSubApplications.class.php"
|
2. Defining to which clients the scripts should be deployed
Step 2. From the EnterpriseScripts folder, open the following file:
Enterprise_Scripts_SysGetSubApplications.class.php
Step 3. Locate the logic that defines which zipped file each client should receive and change it to your needs by pointing each path to the file that needs to be deployed:
if( $req->ClientAppName == 'InDesign' ) {
$subApp->PackageUrl = SERVERURL_ROOT.INETROOT.'/server/plugins/EnterpriseScripts/SubApplication/IDScripts.zip';
}
else if( $req->ClientAppName == 'InCopy' ) {
$subApp->PackageUrl = SERVERURL_ROOT.INETROOT.'/server/plugins/EnterpriseScripts/SubApplication/ICScripts.zip';
}
else {
$subApp->PackageUrl = SERVERURL_ROOT.INETROOT.'/server/plugins/EnterpriseScripts/SubApplication/EnterpriseScripts.zip';
}
3. Verifying that the plug-in is active
Step 4. In Enterprise Server, access the Server Plug-in Maintenance page.
In Enterprise Server, click Server Plug-ins in the Maintenance menu or on the Home page.
Step 5. Locate the plug-in named Enterprise Scripts and verify that the icon in front of the installed plug-in is green. If it is not, click the icon to enable the plug-in.
4. Testing the working of the plug-in
Step 6. Access the Health Check page.
In the Maintenance menu or on the Home page, click Advanced followed by Health Check.
Step 7. Clear all tests, select only the test Enterprise Scripts and run the test. The result should display as OK.
5. Controlling to which users the script should be deployed
Step 8. Use the Access Right named Enterprise Scripts in an Access Profile to control to which user group the scripts should be deployed.
Do this by updating and existing Access Profile or creating a new one.
Note: The 'Enterprise Scripts' option is listed under 'Applications'.
Configuring additional plug-ins
In the following steps, a copy of an existing plug-in is made. Each created plug-in will have a dedicated Access Right to define to which user groups the scripts should be deployed. Other than that, the working is identical to that of using the default plug-in.
1. Copying an existing plug-in
Step 1. Copy an existing plug-in, place it in the Enterprise/config folder and rename it:
<Enterprise Server path>/Enterprise/config/plugins/<new plug-in name>
Example: Copy the default EnterpriseScripts plug-in from the Enterprise/server folder: <Enterprise Server path>/Enterprise/server/plugins/EnterpriseScripts |
Note: Use a descriptive name and do not use spaces or special characters.
2. Renaming plug-in files
Step 2. Open the plug-in folder and re-name the following files by replacing the name of the old plug-in with that of the new plug-in:
Old name | New name |
---|---|
EnterpriseScripts_SysGetSubApplications.class.php | <new plug-in name>_SysGetSubApplications.class.php |
/testsuite/HealthCheck2/EnterpriseScripts_TestCase.php | /testsuite/HealthCheck2/<new plug-in name>_TestCase.php |
Example: Here the files are renamed using the plug-in name "LayoutScripts"
|
3. Renaming plug-in references in plug-in files
Step 3. Open the file <plug-in name>_SysGetSubApplications.class.php file and replace all references to the old plug-in name with that of the new plug-in name.
Example: If you have copied the default plug-in named 'EnterpriseScripts', replace 'EnterpriseScripts' by the new plug-in name. The following image shows all locations of 'EnterpriseScripts' in the file: |
Step 4. Open the file <plug-in name>_TestCase.php file and replace all references to the old plug-in name with that of the new plug-in name.
Example: If you have copied the default plug-in named 'EnterpriseScripts', replace 'EnterpriseScripts' by the new plug-in name. The following image shows all locations of 'EnterpriseScripts' in the file: |
Step 5. Open the file PluginInfo.php file and replace all references to the old plug-in name with that of the new plug-in name.
Example: If you have copied the default plug-in named 'EnterpriseScripts', replace 'EnterpriseScripts' and 'Enterprise Scripts' by the new plug-in name. The following image shows all locations of 'EnterpriseScripts' and 'Enterprise Scripts' in the file: |
4. Configuring the plug-in
Step 6. To install the scripts, target the client applications, assign user groups and test the plug-in, follow the steps for Configuring the default plug-in.
Note: Replace the references to 'EnterpriseScripts' and 'Enterprise Scripts' with the name that you have given the new plug-in.
Updating existing scripts
When replacing an existing script with a newer version, the client needs to be triggered to download this updated script.
To make this work, update the version number in the following file:
/Enterprise/server/plugins/EnterpriseScripts/EnterpriseScripts_SysGetSubApplications.class.php
Example: $subApp->Version = '1.0';
Client-side functionality
The deployment of scripts works as follows in InDesign, InDesign Server and InCopy:
When the user logs in:
- A validation is performed to see if scripts are available for the client application and if the user is allowed to use them.
Note: The user is allowed access to the scripts if the user is in any user group that is allowed access to the Enterprise Scripts for any Brand/Status/Category combination.
- When the validation is passed, one of the following occurs:
- Any existing scripts that were stored when logging in to a different Enterprise Server are removed
- Any scripts that are not yet available are downloaded
- Any scripts that are already available are updated
- Any locally installed event scripts that have the same name as the installed server scripts are overruled
When the user logs out:
- Any installed scripts are not removed so that they are available when working in offline mode.
Location where the deployed scripts are installed
- On Mac OS:
- /Users/<user_name>/Library/Preferences/Adobe InDesign/Version <version_number>/<localId>/Scripts/EnterpriseScripts
- On Windows:
- c:\Users\<user_name>\AppData\Roaming\Adobe\<app_name>\Version <version_number>\<localId>\Scripts\EnterpriseScripts
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.