Adobe 23102480 Scripting Guide - Page 8

Scripting Support in Photoshop CS3, JavaScript Support - photoshop cs3 for windows

Page 8 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can perform actions that involve multiple applications. For example, depending on the scripting language you are using, you could target both Photoshop CS3 and another Adobe Creative Suite 3 Application, such as Illustrator® CS3, in the same script. ● You can open, save, and rename files using scripts. ● You can copy scripts from one computer to another. If you were using an Action and then switched computers, you'd have to recreate the Action. ● Scripts provide more versatility for automatically opening files. When opening a file in an action, you must hard code the file location. In a script, you can use variables for file paths. Note: See Photoshop CS3 Help for more information on Photoshop CS3 Actions. Scripting Support in Photoshop CS3 Photoshop CS3 supports scripting in three scripting languages: AppleScript, VBScript, and JavaScript. AppleScript and JavaScript run on Mac OS, and JavaScript and VBScript run on Windows. For information about how to choose which scripting language to use, and for additional information about using these languages with Adobe applications, see Introduction to Scripting. See 'Creating and Running an AppleScript' on page 15, 'Creating and Running a VBScript' on page 16, and 'Creating and Running a JavaScript' on page 17. You can call JavaScript scripts from AppleScript and VBScript scripts. See 'Executing JavaScripts from AS or VBS' on page 9. For a file to be recognized by Photoshop as a valid script file it must have the correct file name extension: Script Type AppleScript JavaScript ExtendScript VBScript Visual Basic File Type compiled script OSAS file text text executable Extension .scpt (none) .js .jsx .vbs .exe Platform Mac OS® Mac OS & Windows Windows Windows JavaScript Support For a JavaScript file to be recognized by Photoshop as a valid script file, it must use either a .js or a .jsx extension. On the Mac OS, there is no difference in the way scripts with the two extensions function. On Windows, if the script files is opened from inside Photoshop, there is no difference between using the .js and .jsx extension. However, if the script is launched by double-clicking on it, a script with the .js extension is interpreted with the Microsoft JScript engine, and it cannot launch Photoshop CS3. For Windows, using the .jsx extension is preferable, since it interprets the script with the ExtendScript engine. Scripts written in JavaScript can be accessed from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which provides quick and easy access to your JavaScripts. By putting a JavaScript file into the appropriate location on disk, it can be accessed directly from the Photoshop CS3 menu.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85

Photoshop CS3
Adobe Photoshop CS3
Scripting Guide
Photoshop CS3 Scripting Basics
8
A single script can perform actions that involve multiple applications. For example, depending on the
scripting language you are using, you could target both Photoshop CS3 and another Adobe Creative
Suite 3 Application, such as Illustrator
®
CS3, in the same script.
You can open, save, and rename files using scripts.
You can copy scripts from one computer to another. If you were using an Action and then switched
computers, you’d have to recreate the Action.
Scripts provide more versatility for automatically opening files. When opening a file in an action, you
must hard code the file location. In a script, you can use variables for file paths.
Note:
See Photoshop CS3 Help for more information on Photoshop CS3 Actions.
Scripting Support in Photoshop CS3
Photoshop CS3 supports scripting in three scripting languages: AppleScript, VBScript, and JavaScript.
AppleScript and JavaScript run on Mac OS, and JavaScript and VBScript run on Windows. For information
about how to choose which scripting language to use, and for additional information about using these
languages with Adobe applications, see
Introduction to Scripting.
See
‘Creating and Running an AppleScript’ on page 15
,
‘Creating and Running a VBScript’ on page 16
, and
‘Creating and Running a JavaScript’ on page 17
.
You can call JavaScript scripts from AppleScript and VBScript scripts. See
‘Executing JavaScripts from AS or
VBS’ on page 9
.
For a file to be recognized by Photoshop as a valid script file it must have the correct file name extension:
JavaScript Support
For a JavaScript file to be recognized by Photoshop as a valid script file, it must use either a
.js
or a
.jsx
extension. On the Mac OS, there is no difference in the way scripts with the two extensions function. On
Windows, if the script files is opened from inside Photoshop, there is no difference between using the
.js
and
.jsx
extension. However, if the script is launched by double-clicking on it, a script with the
.js
extension is interpreted with the Microsoft JScript engine, and it cannot launch Photoshop CS3. For
Windows, using the
.jsx
extension is preferable, since it interprets the script with the ExtendScript
engine.
Scripts written in JavaScript can be accessed from the Adobe Photoshop CS3 Scripts menu (
File > Scripts
),
which provides quick and easy access to your JavaScripts. By putting a JavaScript file into the appropriate
location on disk, it can be accessed directly from the Photoshop CS3 menu.
Script Type
File Type
Extension
Platform
AppleScript
compiled script
OSAS file
.scpt
(none)
Mac OS®
JavaScript
ExtendScript
text
.js
.jsx
Mac OS & Windows
VBScript
text
.vbs
Windows
Visual Basic
executable
.exe
Windows