Adobe 27510753 Scripting Guide - Page 82
Namespace specifiers, Script locations and checking application installation - illustrator
![]() |
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 82 highlights
74 Using ExtendScript Tools and Features Adobe InDesign CS2 Scripting Guide Namespace specifiers When calling cross-DOM and exported functions from other applications, a namespace specifier qualifies the function call, directing it to the appropriate application.Namespace specifiers consist of an application name, as used in an application specifier, with an optional major version number. Use it as a prefix to an exported function name, with the JavaScript dot notation. appname[majorVersion].functionName(args) For example: l To call the cross-DOM function quit in Photoshop CS2, use photoshop.quit(), and to call it in GoLive CS2, use golive.quit(). l To call the exported function place, defined for Illustrator® CS version 12, call illustrator12. place(myFiles). For information about the cross-DOM and exported functions, see the Bridge JavaScript Reference, available with Adobe Creative Suite 2. Script locations and checking application installation On startup, all Adobe Creative Suite 2 applications execute all JSX files that they find in the user startup folder: l In Windows, the startup folder is: %APPDATA%\Adobe\StartupScripts l In Mac OS, the startup folder is ~/Library/Application Support/Adobe/StartupScripts/ A script in the startup directory is executed on startup by all applications. If you place a script here, it must contain code to check whether it is being run by the intended application. You can do this using the appName static property of the BridgeTalk class. For example: if( BridgeTalk.appName == "bridge" ) { //continue executing script } In addition, each application looks for application-specific scripts in a subfolder named with that application's specifier and version, in the form: %APPDATA%\Adobe\StartupScripts\appname\version ~/Library/Application Support/Adobe/StartupScripts/appname/version/ The name and version in these folder names are specified in the form required for Application specifiers. For example, in Windows, GoLive CS2 version 8.2 would look for scripts in the directory: %APPDATA%\Adobe\StartupScripts\golive\8.2 The version portion of the Bridge-specific folder path is an exact version number. That is, scripts in the folder bridge/1.5 are executed only by Bridge version 1.5, and so on. If a script that is run by one application will communicate with another application, or add functionality that depends on another application, it must first check whether that application and version is installed. You can do this using the BridgeTalk.getSpecifier static function. For example: if( BridgeTalk.appName == "bridge" ) { // Check that PS CS2 is installed if( BridgeTalk.getSpecifier("photoshop",9)){ // add PS automate menu to Bridge UI } } For interapplication communication details, see the Bridge JavaScript Reference, available with Creative Suite 2.
![](/manual_guide/products/adobe-27510753-scripting-guide-5f6265c/82.png)