Adobe 65014293 Scripting Guide - Page 22

Viewing Photoshop’s type library (VBS), Targeting and Referencing the Application Object

Page 22 highlights

CHAPTER 3: Scripting Photoshop Targeting and Referencing the Application Object 22 NOTE: The Photoshop AppleScript Dictionary does not display the complete list of open and save formats. Viewing Photoshop's type library (VBS) You can use the VBA editor in Microsoft Word to display the objects and commands available for VBScript in Photoshop. To view the VBS object library in Microsoft Word: 1. Start Word, and then choose Tools > Macro > Visual Basic Editor. 2. Choose Tools > References, and then select the Adobe Photoshop Type Library check box and click OK. 3. Choose View > Object Browser. 4. Choose Photoshop CS4 type library from the list of open libraries shown in the top-left pull-down menu. 5. Choose an object class to display more information abut the class. You can also use the object browser in the Visual Basic development environment to display the objects and commands available for VBScript in Photoshop. To view the VBS object library in the Visual Basic development environment: 1. Start Visual Studio 2005, or Visual Basic. 2. Select View > Object Browser. 3. In the Browse drop-down box, select Edit Custom Component Set. 4. On the COM tab, find "Adobe Photoshop CS4 Object Library". Select it. 5. Click Add. The selected library appears in the "Selected Projects and Components" portion of the window. 6. Click OK. 7. Now the Photoshop Library is loaded into the object browser. Click on the plus sign next to the Photoshop Library icon. 8. Click on the plus sign next to the Photoshop objects icon. 9. The objects defined in the Photoshop library are listed. You can select one to display more information about the class. Targeting and Referencing the Application Object Because you run your AppleScript and VBScript scripts from outside the Photoshop application, the first thing your script should do is indicate that the commands be executed in Photoshop. NOTE: In JavaScript, you do not need to target the Application object because you open the scripts from the Photoshop application itself. (See "Creating and running a JavaScript" on page 19.)

  • 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

C
HAPTER
3: Scripting Photoshop
Targeting and Referencing the Application Object
22
N
OTE
:
The Photoshop AppleScript Dictionary does not display the complete list of open and save formats.
Viewing Photoshop’s type library (VBS)
You can use the VBA editor in Microsoft Word to display the objects and commands available for VBScript
in Photoshop.
To view the VBS object library in Microsoft Word:
1.
Start Word, and then choose
Tools > Macro > Visual Basic Editor
.
2.
Choose
Tools > References
, and then select the Adobe Photoshop Type Library check box and click
OK
.
3.
Choose
View > Object Browser
.
4.
Choose Photoshop CS4
type library
from the list of open libraries shown in the top-left pull-down
menu.
5.
Choose an object class to display more information abut the class.
You can also use the object browser in the Visual Basic development environment to display the objects
and commands available for VBScript in Photoshop.
To view the VBS object library in the Visual Basic development environment:
1.
Start Visual Studio 2005, or Visual Basic.
2.
Select
View > Object Browser.
3.
In the Browse drop-down box, select
Edit Custom Component Set
.
4.
On the COM tab, find “Adobe Photoshop CS4 Object Library”. Select it.
5.
Click
Add
. The selected library appears in the “Selected Projects and Components” portion of the
window.
6.
Click
OK
.
7.
Now the Photoshop Library is loaded into the object browser. Click on the plus sign next to the
Photoshop Library icon.
8.
Click on the plus sign next to the Photoshop objects icon.
9.
The objects defined in the Photoshop library are listed. You can select one to display more information
about the class.
Targeting and Referencing the Application Object
Because you run your AppleScript and VBScript scripts from outside the Photoshop application, the first
thing your script should do is indicate that the commands be executed in Photoshop.
N
OTE
:
In JavaScript, you do not need to target the
Application
object because you open the scripts from
the Photoshop application itself. (See
“Creating and running a JavaScript” on page 19
.)