Adobe Smoke Alarm CS3 Manuale Utente

Pagina di 85
Photoshop CS3
Adobe Photoshop CS3  Scripting Guide
 Photoshop CS3 Scripting Basics     9
To install a JavaScript in the Scripts menu, place it in the Scripts folder (Photoshop CS3 /Presets /Scripts). 
The names of the scripts in the Scripts folder, without the file name extension, are displayed in the Scripts 
menu. Any number of scripts may be installed in the Scripts menu.
Scripts added to the Scripts folder while Photoshop CS3 is running do not appear in the Scripts menu until 
the next time you launch the application.
All scripts found in the Scripts folder and sub-folders are displayed at the top level of the File > Scripts 
menu. The addition of sub-folders does not add a hierarchical organization to the Scripts menu.
Executing other scripts
The Browse item at the end of the Scripts menu (File > Scripts > Browse) allows you to execute scripts 
that are not installed in the Scripts folder. You can also use Browse to select scripts installed in the Scripts 
folder after the application was last launched. 
Selecting Browse displays a file browser dialog which allows you to select a script file for execution. Only 
.js
 or 
.jsx
 files are displayed in the browse dialog. When you select a script file, it is executed the same 
way as an installed script.
Startup Scripts
On startup, Photoshop CS3 executes all 
.jsx
 files that it finds in the startup folders. 
On Windows, the startup folder for user-defined scripts is: 
C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe Photoshop
On Mac OS, the startup folder for user-defined scripts is: 
~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop
If your script is in this main startup folder, it is also executed by all other Adobe Creative Suite 3 
applications at startup. If such a script is meant to be executed only by Photoshop CS3, it must include 
code such as the following: 
if( BridgeTalk.appName == "photoshop" ) {
//continue executing script
}
For additional details, see the JavaScript Tools Guide.
Executing JavaScripts from AS or VBS
You can take advantage of JavaScript’s platform-independence by running scripts from AppleScript or 
VBScript. You can execute either a single JavaScript statement or a complete JavaScript file. For more 
information, please refer to Introduction to Scripting.
Photoshop CS3 Object Model
A document object model (DOM) is an application programming interface (API), which allows you to 
programmatically access various components of a document (as defined for that application) through a 
scripting language. For additional information about Adobe object models and the scripting languages 
that support them, see Introduction to Scripting.
The Photoshop CS3 DOM consists of a hierarchical representation of the Photoshop application, the 
documents used in it, and the components of the documents. The DOM allows you to programmatically 
access and manipulate the document and its components. For example, through the DOM, you can create