Adobe 23101335 Scripting Guide - Page 8

Legacy COM scripting, documentation in the OLE Automation Programming Guide.

Page 8 highlights

Introduction 1 Legacy COM scripting the facilities to directly address other applications. For example, you cannot easily write a JavaScript to manage workflows involving Photoshop and a database management program. AppleScript and Visual Basic are only offered on their respective platforms. However, you can write scripts in those languages to control multiple applications. For example, you can write an AppleScript that first manipulates a bitmap in Photoshop and then commands a web design application to incorporate it. This same cross-application capability is also available with Visual Basic on Windows. You may also use other scripting languages when working with Photoshop Scripting Support. On Mac OS, any language which lets you send Apple events, such as MacPerl, TCL, or Latenight Software's JavaScript component, can be used to script Photoshop. On Windows, any language which is COM aware can be used to script Photoshop. This includes languages available in Windows Scripting Host, such as VBScript and JScript, as well as other scripting languages like Perl, Tcl/Tk, and Python. 1.8 Legacy COM scripting Photoshop 5, Photoshop 6 and Photoshop 7 support COM scripting without the optional Scripting Support plug-in. This scripting interface is described in the Photoshop SDK documentation in the "OLE Automation Programming Guide." You can use both the old stype COM scripts and the new style COM scripts with Photoshop 7.0, but you have to modify the way that you refer to the Photoshop application object in your old scripts after you install ScriptingSupport. Typically you would create a Photoshop application instance by saying: Set App = CreateObject("Photoshop.Application") after installing ScriptingSupport, you must change the above code to Set App = CreateObject("Photoshop.Application.7") Note that the latter version will work both with and without ScriptingSupport installed. Photoshop 7.0 Scripting Guide 8

  • 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
8
Introduction
Legacy COM scripting
1
the facilities to directly address other applications. For example, you cannot easily write a
JavaScript to manage workflows involving Photoshop and a database management program.
AppleScript and Visual Basic are only offered on their respective platforms. However, you can
write scripts in those languages to control multiple applications. For example, you can write an
AppleScript that first manipulates a bitmap in Photoshop and then commands a web design
application to incorporate it. This same cross-application capability is also available with
Visual Basic on Windows.
You may also use other scripting languages when working with Photoshop Scripting Support.
On Mac OS, any language which lets you send Apple events, such as MacPerl, TCL, or
Latenight Software's JavaScript component, can be used to script Photoshop.
On Windows, any language which is COM aware can be used to script Photoshop. This
includes languages available in Windows Scripting Host, such as VBScript and JScript, as
well as other scripting languages like Perl, Tcl/Tk, and Python.
1.8 Legacy COM scripting
Photoshop 5, Photoshop 6 and Photoshop 7 support COM scripting without the optional
Scripting Support plug-in. This scripting interface is described in the Photoshop SDK
documentation in the “OLE Automation Programming Guide.”
You can use both the old stype COM scripts and the new style COM scripts with Photoshop
7.0, but you have to modify the way that you refer to the Photoshop application object in your
old scripts after you install ScriptingSupport.
Typically you would create a Photoshop application instance by saying:
Set App = CreateObject("Photoshop.Application")
after installing ScriptingSupport, you must change the above code to
Set App = CreateObject("Photoshop.Application.7")
Note that the latter version will work both with and without ScriptingSupport installed.