Adobe 23102480 Scripting Guide - Page 20

Viewing Photoshop CS3’s Type Library (VBS), Targeting and Referencing the Application Object

Page 20 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 20 Viewing Photoshop CS3's Type Library (VBS) You can use the VBA editor in Microsoft Word to display the objects and commands available for VBScript in Photoshop CS3. ➤ 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 CS3 Type Library check box and click OK. 3. Choose View > Object Browser. 4. Choose Photoshop CS3 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 CS3. ➤ 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 CS3 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 CS3 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 CS3 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 CS3 application, the first thing your script should do is indicate that the commands be executed in Photoshop CS3. Note: In JavaScript, you do not need to target the Application object because you open the scripts from the Photoshop CS3 application itself. (See 'Creating and Running a JavaScript' on page 17.) AS To target Photoshop CS3 in AppleScript, you must enclosing your script in the following statements: tell application "Adobe Photoshop CS3"

  • 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
Scripting Photoshop CS3
20
Viewing Photoshop CS3’s Type Library (VBS)
You can use the VBA editor in Microsoft Word to display the objects and commands available for VBScript
in Photoshop CS3.
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 CS3 Type Library check box and
click
OK
.
3.
Choose
View > Object Browser
.
4.
Choose Photoshop CS3
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 CS3.
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 CS3 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 CS3 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 CS3 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 CS3 application, the
first thing your script should do is indicate that the commands be executed in Photoshop CS3.
Note:
In JavaScript, you do not need to target the
Application
object because you open the scripts from
the Photoshop CS3 application itself. (See
‘Creating and Running a JavaScript’ on page 17
.)
AS
To target Photoshop CS3 in AppleScript, you must enclosing your script in the following statements:
tell application "Adobe Photoshop CS3"