Adobe 23102480 - Photoshop CS3 - PC Programming Manual page 77

Scripting guide
Table of Contents

Advertisement

Adobe Photoshop CS3 Scripting Guide
id9 = objApp.CharIDToTypeID( "Embs" )
DIM desc4
SET desc4 = CreateObject( "Photoshop.ActionDescriptor" )
DIM id10
id10 = objApp.CharIDToTypeID( "Angl" )
Call desc4.PutInteger( id10, angle )
DIM id11
id11 = objApp.CharIDToTypeID( "Hght" )
Call desc4.PutInteger( id11, height )
DIM id12
id12 = objApp.CharIDToTypeID( "Amnt" )
Call desc4.PutInteger( id12, amount )
Call objApp.ExecuteAction( id9, desc4, dialogMode )
End Function
5. To use a VBScript to apply the Emboss filter to a document, include the emboss function in the script
and call the function with the desired parameters. For example, the following example applies the
Emboss filter with angle 75, height 2, and amount 89. Before the script calls the function, it needs to
have an open document. (See
document within the script.) Since the script is opening a document, it needs access to the Photoshop
DOM when it calls the
Photoshop
DIM objApp
SET objApp = CreateObject("Photoshop.Application")
'Open the document in the script
filename = "C:\MyFile"
DIM docRef
SET docRef = objApp.Open(filename)
'Call emboss with desired parameters
Call Emboss( 75, 2, 89 )
Function Emboss( angle, height, amount )
REM Use dialog mode 3 for show no dialogs
DIM dialogMode
dialogMode = 3
DIM id9
id9 = objApp.CharIDToTypeID( "Embs" )
DIM desc4
SET desc4 = CreateObject( "Photoshop.ActionDescriptor" )
DIM id10
id10 = objApp.CharIDToTypeID( "Angl" )
Call desc4.PutInteger( id10, angle )
DIM id11
id11 = objApp.CharIDToTypeID( "Hght" )
Call desc4.PutInteger( id11, height )
DIM id12
id12 = objApp.CharIDToTypeID( "Amnt" )
Call desc4.PutInteger( id12, amount )
Call objApp.ExecuteAction( id9, desc4, dialogMode )
End Function
6. Apply the emboss filter script by double clicking on the file
opens the file and applies the emboss filter to the file.
'Opening a Document' on page
Application .Open
.
object before it opens a new document.
Application
Photoshop CS3
method, so the script must create the
emboss.vbs
Action Manager
26, for help in writing the code to open a
. This launches Photoshop,
77

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 23102480 - Photoshop CS3 - PC and is the answer not in the manual?

This manual is also suitable for:

13102498 - photoshop cs3 - macPhotoshop cs3

Table of Contents