Adobe 23101335 Scripting Guide - Page 84

Action Manager scripting, 3.17.1 Using the Action Manager from JavaScript

Page 84 highlights

Scripting Photoshop 3 Action Manager scripting 3.17 Action Manager scripting The Action Manager allows you to write scripts that target functionality that is not otherwise accessible. You are able to script third party plug-ins, filters, and other tasks that are not otherwise included in the scripting interface. The only requirement is that the task that you want to access from the Action Manager is recordable. The classes "ActionDescriptor", "ActionReference" and "ActionList" are all part of the Action Manager functionality. When you write scripts that use the Action Manager, you should install the "ScriptingListener" plug-in. It is located inside the "utilities" folder that is part of the scripting support download. To install the plug-in place it in the Photoshop 7.0\Plug-Ins\Scripting\ folder. "ScriptingListener" records most of your actions to a file on your hard drive. To avoid slowing down Photoshop as well as not to create a big file on your drive, only install the plug-in when you are creating Action Manager scripts. When "ScriptingListener" is installed it will record a file with scripting code corresponding to the actions that you perform from the UI. The Windows version of "ScriptingListener" creates the following 2 files: ● C:\ScriptingListenerJS.log: contains JavaScript code corresponding to the actions that are performed from the UI. ● C:\ScriptingListenerVB.log: contains VBScript code corresponding to the actions that are performed from the UI. The Macintosh version "ScriptingListener" creates the following file: ● ScriptingListenerJS.log: the file is created on the desktop, and contains JavaScript code corresponding to the actions that are performed from the UI. Note: There is no AppleScript interface to the Action Manager, but you can execute JavaScripts from AppleScript, so you are able to access Action Manager functionality from AppleScripts. See section, "Running JavaScript based Action Manager code from AppleScript" on page 86 for more information on how to call JavaScript code from AppleScript. 3.17.1 Using the Action Manager from JavaScript As an example let's say that you want to be able to use the Emboss filter. The Emboss filter is not part of the filters that are exposed to the various scripting languages, but using the Action Manager you are able to use this filter. First make sure that you have installed the "ScriptingListener". Then from the UI, open a document and apply the Emboss filter using the settings: angle 135, height 3 and amount 100. Photoshop 7.0 Scripting Guide 84

  • 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
  • 89
  • 90
  • 91

Photoshop 7.0 Scripting Guide
84
Scripting Photoshop
Action Manager scripting
3
3.17 Action Manager scripting
The Action Manager allows you to write scripts that target functionality that is not otherwise
accessible. You are able to script third party plug-ins, filters, and other tasks that are not
otherwise included in the scripting interface. The only requirement is that the task that you
want to access from the Action Manager is recordable.
The classes “ActionDescriptor”, “ActionReference” and “ActionList” are all part of the
Action Manager functionality.
When you write scripts that use the Action Manager, you should install the
“ScriptingListener” plug-in. It is located inside the “utilities” folder that is part of the scripting
support download.
To install the plug-in place it in the
Photoshop 7.0\Plug-Ins\Scripting\
folder.
“ScriptingListener” records most of your actions to a file on your hard drive. To avoid slowing
down Photoshop as well as not to create a big file on your drive, only install the plug-in when
you are creating Action Manager scripts.
When “ScriptingListener” is installed it will record a file with scripting code corresponding to
the actions that you perform from the UI.
The Windows version of “ScriptingListener” creates the following 2 files:
C:\ScriptingListenerJS.log
: contains JavaScript code corresponding to the actions that
are performed from the UI.
C:\ScriptingListenerVB.log
: contains VBScript code corresponding to the actions that are
performed from the UI.
The Macintosh version “ScriptingListener” creates the following file:
ScriptingListenerJS.log
: the file is created on the desktop, and contains JavaScript code
corresponding to the actions that are performed from the UI.
Note: There is no AppleScript interface to the Action Manager, but you can execute
JavaScripts from AppleScript, so you are able to access Action Manager functionality from
AppleScripts. See section
, “Running JavaScript based Action Manager code from
AppleScript” on page 86
for more information on how to call JavaScript code from
AppleScript.
3.17.1 Using the Action Manager from JavaScript
As an example let’s say that you want to be able to use the Emboss filter. The Emboss filter is
not part of the filters that are exposed to the various scripting languages, but using the Action
Manager you are able to use this filter. First make sure that you have installed the
“ScriptingListener”. Then from the UI, open a document and apply the Emboss filter using the
settings: angle 135, height 3 and amount 100.