Adobe 65048599 Scripting Guide - Page 77

to another, Copy the VBScript code associated with the emboss action

Page 77 highlights

CHAPTER 4: Action Manager Using the Action Manager from a VBS Script 77 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 DIM id9 id9 = objApp.CharIDToTypeID( "Embs" ) DIM desc4 SET desc4 = CreateObject( "Photoshop.ActionDescriptor" ) DIM id10 id10 = objApp.CharIDToTypeID( "Angl" ) Call desc4.PutInteger( id10, 135 ) DIM id11 id11 = objApp.CharIDToTypeID( "Hght" ) Call desc4.PutInteger( id11, 3 ) DIM id12 id12 = objApp.CharIDToTypeID( "Amnt" ) Call desc4.PutInteger( id12, 100 ) Call objApp.ExecuteAction( id9, desc4, dialogMode ) NOTE: ScriptListener separates logged commands with horizontal lines composed of equal signs (====...). If this is not the first action recorded in the log, you can easily locate the most recent action; it follows the final equal sign line. 2. Copy the VBScript code associated with the emboss action from ScriptListenerVB.log to another file, called emboss.vbs. 3. In the emboss.vbs script, identify the values that you used with the filter (135, 3, and 100). Substitute the filter specification values with variable names. In the following example, 135 has been replaced with angle, 3 has been replaced with height, and 100 has been replaced with amount. DIM objApp SET objApp = CreateObject("Photoshop.Application") 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 )

  • 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
4: Action Manager
Using the Action Manager from a VBS Script
77
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
DIM id9
id9 = objApp.CharIDToTypeID( "Embs" )
DIM desc4
SET desc4 = CreateObject( "Photoshop.ActionDescriptor" )
DIM id10
id10 = objApp.CharIDToTypeID( "Angl" )
Call desc4.PutInteger( id10, 135 )
DIM id11
id11 = objApp.CharIDToTypeID( "Hght" )
Call desc4.PutInteger( id11, 3 )
DIM id12
id12 = objApp.CharIDToTypeID( "Amnt" )
Call desc4.PutInteger( id12, 100 )
Call objApp.ExecuteAction( id9, desc4, dialogMode )
N
OTE
:
ScriptListener separates logged commands with horizontal lines composed of equal signs
(====...). If this is not the first action recorded in the log, you can easily locate the most recent action;
it follows the final equal sign line.
2.
Copy the VBScript code associated with the emboss action from
ScriptListenerVB.log
to another
file, called
emboss.vbs
.
3.
In the
emboss.vbs
script, identify the values that you used with the filter (135, 3, and 100). Substitute
the filter specification values with variable names.
In the following example,
135
has been replaced with
angle
,
3
has been replaced with
height
, and
100
has been replaced with
amount
.
DIM objApp
SET objApp = CreateObject("Photoshop.Application")
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 )