Executing Scripts¶
The Illustrator interface includes a Scripts menu (File > Scripts) that provides quick and easy access to your scripts.
Scripts can be listed directly as menu items that run when you select them. See Installing scripts in the Scripts menu.
You can navigate from the menu to any script in your file system and then run the script. See Executing scripts from the Other Scripts menu item.
You also can have JavaScript scripts with a .jsx extension start automatically when you launch the application. For information, see Startup scripts (.jsx scripts only).
Startup scripts (.jsx scripts only)¶
JavaScript scripts with a .jsx file extension can be installed in one of two folders, so the scripts run automatically when you launch Illustrator and each time you run a script.
The folders are:
An application-specific startup scripts folder, which contains scripts for IllustratorCC
A general startup scripts folder, which contains scripts that run automatically when you start any Creative Cloud application
Application-specific startup scripts folder¶
You must place application-specific startup scripts in a folder named Startup Scripts, which you create in the Illustrator installation directory.
For example, when IllustratorCC is installed to its default location, you would create the Startup Scripts folder at the following location:
Windows |
|
Mac OS |
|
JavaScript scripts with a .jsx extension placed in the Startup Scripts folder run automatically when:
The application is launched.
Any JavaScript file is selected from the Scripts menu (File > Scripts).
General startup scripts folder¶
The general startup scripts folder contains scripts that run automatically when you start any Creative Cloud application.
You create the folder in the following location:
Windows |
|
Mac OS |
|
If a script in the general startup folder is meant to be executed only by Illustrator, the script must include the ExtendScript #target directive ( #target illustrator
) or code like the following
if (BridgeTalk.appName == "illustrator") {
// continue executing script
}