Adobe 23102480 Scripting Guide - Page 75
Using the Action Manager from a VBS Script, To create a VBScript from the ScriptListener output
UPC - 883919080222
View all Adobe 23102480 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 75 highlights
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Action Manager 75 desc4.putInteger( id20, angle ); var id21 = charIDToTypeID( "Hght" ); desc4.putInteger( id21, height ); var id22 = charIDToTypeID( "Amnt" ); desc7.putInteger( id22, amount ); executeAction( id19, desc4 ,DialogModes.NO); } 5. To use a JavaScript to apply the Emboss filter to a document, include the emboss function in the JavaScript 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. (See 'Opening a Document' on page 26, for help in writing the code to open a document within the script.) // Open the document in the script var fileRef = new File("/c/myfile") var docRef = app.open(fileRef) //Call emboss with desired parameters emboss( 75, 2, 89 ); //finish the script //include the function in the script file function emboss(angle, height, amount ) { var id32 = charIDToTypeID( "Embs" ); var desc7 = new ActionDescriptor(); var id33 = charIDToTypeID( "Angl" ); desc7.putInteger( id33, angle ); var id34 = charIDToTypeID( "Hght" ); desc7.putInteger( id34, height ); var id35 = charIDToTypeID( "Amnt" ); desc7.putInteger( id35, amount ); executeAction( id32, desc7,DialogModes.NO ); } 6. Open Photoshop CS3, to apply the emboss filter by selecting File > Scripts > Browse, and then browsing to the location of your emboss.jsx script. Select Open to run the script. Using the Action Manager from a VBS Script The section demonstrates how to use the contents of the ScriptingListenerVB.log log to create your script. Before you begin this section, you need to have already recorded an action. The example in this section assumes you have followed the instructions in 'Recording a Script using ScriptListener' on page 73. The procedures in this section use the Action Manager to make the Emboss filter available to the scripting interface. ➤ To create a VBScript from the ScriptListener output: 1. Open ScriptingListenerVB.log from the desktop. At the end of the file you will see code similar to the following (although your numbers may be different): DIM objApp SET objApp = CreateObject("Photoshop.Application") REM Use dialog mode 3 for show no dialogs DIM dialogMode dialogMode = 3