Namespace Specifiers; Script Locations And Checking Application Installation - Adobe 27510753 - InDesign CS2 - PC Manual

Scripting guide
Hide thumbs Also See for 27510753 - InDesign CS2 - PC:
Table of Contents

Advertisement

74
Using ExtendScript Tools and Features
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
For example:
To call the cross-DOM function quit in Photoshop CS2, use photoshop.quit() , and to call it in GoLive
l
CS2, use golive.quit() .
To call the exported function place , defined for Illustrator® CS version 12, call illustrator12.
l
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:
In Windows, the startup folder is:
l
%APPDATA%\Adobe\StartupScripts
In Mac OS, the startup folder is
l
~/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\
~/Library/Application Support/Adobe/StartupScripts/
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
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.
majorVersion
functionName
[
].
.
are executed only by Bridge version 1.5, and so on.
args
(
)
appname
version
\
appname
Adobe InDesign CS2 Scripting Guide
version
/
/

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents