Adobe 65009333 Scripting Guide - Page 8

Running scripts, Using the scripts panel, JavaScript language details - illustrator

Page 8 highlights

Getting Started Running scripts 8 You also can put in the Scripts Panel folder aliases/shortcuts to scripts or folders containing scripts, and they will appear in the Scripts panel. Running scripts To run a script, display the Scripts panel (choose Window > Scripts), then double-click the script name in the Scripts panel. Many scripts display user-interface items (like dialogs or panels) and display alerts if necessary. Using the scripts panel The Scripts panel can run compiled or uncompiled AppleScripts (files with the file extension .spt, .as, or .applescript), JavaScripts (files with the file extension .js or .jsx), VBScripts (files with the extension .vbs), or executable programs from the Scripts panel. To edit a script shown in the Scripts panel, hold down Option (Mac OS) or Alt (Windows) key and double-click the script's name. This opens the script in the editor you defined for the script file type. To open the folder containing a script shown in the Scripts panel, hold down the Command (Mac OS) or Ctrl-Shift (Windows) keys and double-click the script's name. Alternately, choose Reveal in Finder (Mac OS) or Reveal in Explorer (Windows) from the Scripts panel menu. The folder containing the script opens in the Finder (Mac OS) or Explorer (Windows). Scripts run as a series of actions, which means you can undo the changes the script made to a document by choosing Undo from the Edit menu. This can help you troubleshoot a script, as you can step backward through each change. To add a keyboard shortcut for a script, choose Edit > Keyboard Shortcuts, select an editable shortcut set from the Set menu, then choose Product Area > Scripts. A list of the scripts in your Scripts panel appears. Select a script and assign a keyboard shortcut as you would for any other InCopy feature. JavaScript language details InCopy's JavaScript support is based on an Adobe implementation of JavaScript known as ExtendScript. The ExtendScript interpreter conforms to the current ECMA 262 standard for JavaScript. All language features of JavaScript 1.5 are supported. Adobe Illustrator®, Adobe Photoshop®, and other Adobe Creative Suite® products also use the ExtendScript JavaScript interpreter. While you can write scripts using other versions of JavaScript, such as Late Night Software's OSA JavaScript (on Mac OS) or Microsoft® JScript (on Windows), the terms you use in those languages are not the same as the terms you use in ExtendScript. ExtendScript examples will not work in other JavaScript versions. NOTE: Because ExtendScript tools and features are used in several Adobe products, we consolidated all ExtendScript documentation. To learn more about JavaScript utilities like the ExtendScript Toolkit (a JavaScript development environment and object-model inspector) and the ScriptUI user-interface module, see Creative Suite 3 JavaScript Tools Guide.

  • 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
  • 86
  • 87
  • 88

Getting Started
Running scripts
8
You also can put in the Scripts Panel folder aliases/shortcuts to scripts or folders containing scripts, and
they will appear in the Scripts panel.
Running scripts
To run a script, display the Scripts panel (choose Window > Scripts), then double-click the script name in
the Scripts panel. Many scripts display user-interface items (like dialogs or panels) and display alerts if
necessary.
Using the scripts panel
The Scripts panel can run compiled or uncompiled AppleScripts (files with the file extension
.spt
,
.as
, or
.applescript
), JavaScripts (files with the file extension
.js
or
.jsx
), VBScripts (files with the extension
.vbs
), or executable programs from the Scripts panel.
To edit a script shown in the Scripts panel, hold down Option (Mac OS) or Alt (Windows) key and
double-click the script’s name. This opens the script in the editor you defined for the script file type.
To open the folder containing a script shown in the Scripts panel, hold down the Command (Mac OS) or
Ctrl-Shift (Windows) keys and double-click the script’s name. Alternately, choose Reveal in Finder (Mac OS)
or Reveal in Explorer (Windows) from the Scripts panel menu. The folder containing the script opens in the
Finder (Mac OS) or Explorer (Windows).
Scripts run as a series of actions, which means you can undo the changes the script made to a document
by choosing Undo from the Edit menu. This can help you troubleshoot a script, as you can step backward
through each change.
To add a keyboard shortcut for a script, choose Edit > Keyboard Shortcuts, select an editable shortcut set
from the Set menu, then choose Product Area > Scripts. A list of the scripts in your Scripts panel appears.
Select a script and assign a keyboard shortcut as you would for any other InCopy feature.
JavaScript language details
InCopy’s JavaScript support is based on an Adobe implementation of JavaScript known as
ExtendScript
.
The ExtendScript interpreter conforms to the current ECMA 262 standard for JavaScript. All language
features of JavaScript 1.5 are supported. Adobe Illustrator®, Adobe Photoshop®, and other Adobe Creative
Suite® products also use the ExtendScript JavaScript interpreter.
While you can write scripts using other versions of JavaScript, such as Late Night Software’s OSA JavaScript
(on Mac OS) or Microsoft® JScript (on Windows), the terms you use in those languages are not the same as
the terms you use in ExtendScript. ExtendScript examples will not work in other JavaScript versions.
N
OTE
:
Because ExtendScript tools and features are used in several Adobe products, we consolidated all
ExtendScript documentation. To learn more about JavaScript utilities like the ExtendScript Toolkit (a
JavaScript development environment and object-model inspector) and the ScriptUI user-interface
module, see
Creative Suite 3 JavaScript Tools Guide
.