Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Introduction 4
JavaScript
You can write JavaScripts on either the Mac OS or Windows platform using any text editor. You must save
JavaScript files as text files with a
.jsx
extension.
For more information, see
‘Creating and Running a JavaScript’ on page 24
.
Choosing a scripting language
Your choice of scripting language is determined by two trade-offs:
1. Do you need to run the same script on both Macintosh and Windows computers?
If yes, you must create a JavaScript. See
‘Cross-platform scripts’ on page 4
.
2. Does the task you are scripting involve multiple applications (such as Photoshop CS2 and Illustrator
CS2 or a database program)?
If yes, you must create an AppleScript if you are using a Macintosh; you must create a VBScript script if
you are using Windows. See
‘Scripts that control multiple applications’ on page 5
.
Tip:
You can combine JavaScript’s versatility with the platform-specific advantages of using either
AppleScript or VBScript by executing JavaScripts from your AppleScripts or VBScript scripts. See
‘Executing JavaScripts from AS or VBS’ on page 31
for more information.
Note:
You can use other scripting languages, although they are not documented in this manual.
●
On Mac OS, you can use any language that allows you to send Apple events.
●
On Windows, you can use any OLE Automation-aware language.
Legacy OLE Automation scripting
Photoshop CS2 supports legacy Automation scripting as long as you modify the way that you refer to the
Photoshop CS2
Application
object in your scripts. For example, instead of saying:
Set appRef = CreateObject("Photoshop.Application")
you must change the above code to read:
Set appRef = CreateObject("Photoshop.Application.9.1")
No other change is necessary for legacy COM scripts to run under Photoshop CS2.
Cross-platform scripts
Because JavaScripts performs identically on both Windows and Macintosh computers, it is considered a
cross-platform
scripting language.
You run a JavaScript from within Photoshop CS2 by storing the script in the ...Presets\Scripts folder of your
Photoshop CS2 installation and then selecting the script from the File > Scripts menu.
Running JavaScripts from within Photoshop CS2 eliminates the scripts’ facility to directly address other
applications. For example, you cannot easily write a JavaScript to manage a workflow that involves
Photoshop CS2 and a database management program.
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...