Scripting Guide
Page 5
... About this manual This manual provides an introduction to scripting Adobe® Photoshop® CS3 on page 20. Chapter four covers the Action Manager, which allows you to write scripts that target Photoshop CS3 functionality that property and the VBScript and JavaScript names appear ... outstanding issues. When referring to execute scripts, and the Photoshop CS3 object model. See 'Viewing Photoshop CS3's AppleScript Dictionary' on page 19 and 'Viewing Photoshop CS3's Type Library (VBS)' on Mac OS® and Windows®. Note: Please review the README file shipped with ...
... About this manual This manual provides an introduction to scripting Adobe® Photoshop® CS3 on page 20. Chapter four covers the Action Manager, which allows you to write scripts that target Photoshop CS3 functionality that property and the VBScript and JavaScript names appear ... outstanding issues. When referring to execute scripts, and the Photoshop CS3 object model. See 'Viewing Photoshop CS3's AppleScript Dictionary' on page 19 and 'Viewing Photoshop CS3's Type Library (VBS)' on Mac OS® and Windows®. Note: Please review the README file shipped with ...
Scripting Guide
Page 8
... no difference in the way scripts with the ExtendScript engine. On Windows, if the script files is opened from one computer to Scripting. If you could target both Photoshop CS3 and another Adobe Creative Suite 3 Application, such as a valid script file, it cannot launch Photoshop CS3. For information about using these languages with the Microsoft JScript...
... no difference in the way scripts with the ExtendScript engine. On Windows, if the script files is opened from one computer to Scripting. If you could target both Photoshop CS3 and another Adobe Creative Suite 3 Application, such as a valid script file, it cannot launch Photoshop CS3. For information about using these languages with the Microsoft JScript...
Scripting Guide
Page 9
...for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is in this main startup folder, it finds in the startup folders. ● On Windows, the startup folder for user-defined scripts is...to execute scripts that are displayed at startup. The Photoshop CS3 DOM consists of a hierarchical representation of the Photoshop application, the documents used in it in the Scripts folder (Photoshop CS3 /Presets /Scripts). Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the ...
...for user-defined scripts is: ~/Library/Application Support/Adobe/Startup Scripts CS3/Adobe Photoshop If your script is in this main startup folder, it finds in the startup folders. ● On Windows, the startup folder for user-defined scripts is...to execute scripts that are displayed at startup. The Photoshop CS3 DOM consists of a hierarchical representation of the Photoshop application, the documents used in it in the Scripts folder (Photoshop CS3 /Presets /Scripts). Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 9 To install a JavaScript in the ...
Scripting Guide
Page 13
... Choose File > Scripts > Script Events Manager. Choose Edit > Preferences in Windows, or Photoshop > Preferences in a document. Document The working object, in which you saved it. In Photoshop CS3, choose File > New or File > Open. For example, when a ... an image without using a script: Application The Photoshop CS3 application. Document Info Metadata about an image's color. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Choose Layer > New > Layer...
... Choose File > Scripts > Script Events Manager. Choose Edit > Preferences in Windows, or Photoshop > Preferences in a document. Document The working object, in which you saved it. In Photoshop CS3, choose File > New or File > Open. For example, when a ... an image without using a script: Application The Photoshop CS3 application. Document Info Metadata about an image's color. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 13 Object Name Description To create this object without affecting or Window > Layers. Choose Layer > New > Layer...
Scripting Guide
Page 17
....TEXT // Set the contents of the script. Type the following script. in your Adobe Photoshop CS3 directory. Note: Entering comments is not necessary to open JavaScripts that manipulate Photoshop CS3 from the File > Scripts menu in Windows Explorer to run a JavaScript that opens Photoshop CS3 at the beginning of the text layer. var textItemRef = artLayerRef.textItem textItemRef.contents...
....TEXT // Set the contents of the script. Type the following script. in your Adobe Photoshop CS3 directory. Note: Entering comments is not necessary to open JavaScripts that manipulate Photoshop CS3 from the File > Scripts menu in Windows Explorer to run a JavaScript that opens Photoshop CS3 at the beginning of the text layer. var textItemRef = artLayerRef.textItem textItemRef.contents...
Scripting Guide
Page 20
... 17.) AS To target Photoshop CS3 in AppleScript, you run your AppleScript and VBScript scripts from the list of the window. 6. The selected library appears in the "Selected Projects and Components" portion of open the scripts from the Photoshop CS3 application itself. (See '... display the objects and commands available for VBScript in Photoshop CS3. ➤ To view the VBS object library in the Visual Basic development environment: 1. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 20 Viewing Photoshop CS3's Type Library (VBS) You can use the object...
... 17.) AS To target Photoshop CS3 in AppleScript, you run your AppleScript and VBScript scripts from the list of the window. 6. The selected library appears in the "Selected Projects and Components" portion of open the scripts from the Photoshop CS3 application itself. (See '... display the objects and commands available for VBScript in Photoshop CS3. ➤ To view the VBS object library in the Visual Basic development environment: 1. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 20 Viewing Photoshop CS3's Type Library (VBS) You can use the object...
Scripting Guide
Page 21
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... end tell Note: Because you include all commands in...New Objects in a Script To create a new document in an AppleScript. To create an object in the 'Photoshop CS3 Object Model' on the appropriate palette. See Introduction to name the object type. To reference the Application object... not need to create and then use the following statement creates a Document object in the Photoshop CS3 application, you use the Window menu or choose the New icon on page 9, the Document object contains all properties and ...
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 21 ... end tell Note: Because you include all commands in...New Objects in a Script To create a new document in an AppleScript. To create an object in the 'Photoshop CS3 Object Model' on the appropriate palette. See Introduction to name the object type. To reference the Application object... not need to create and then use the following statement creates a Document object in the Photoshop CS3 application, you use the Window menu or choose the New icon on page 9, the Document object contains all properties and ...
Scripting Guide
Page 27
... up the Photo CD open options class or the EPS open objects class. ● In the Adobe Photoshop CS3 Visual Basic Scripting Reference, or the Adobe Photoshop CS3 JavaScript Scripting Reference, look up the properties for each of file type, look up the PhotoCDOpenOptions or...page 3. ● The document's original shape will open in a window that begin with the file format name. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Specifying File Formats to Open Open Classes Open Options Scripting Photoshop CS3 27 Photo CD Open Options Raw Format Open Options Camera Raw Open ...
... up the Photo CD open options class or the EPS open objects class. ● In the Adobe Photoshop CS3 Visual Basic Scripting Reference, or the Adobe Photoshop CS3 JavaScript Scripting Reference, look up the properties for each of file type, look up the PhotoCDOpenOptions or...page 3. ● The document's original shape will open in a window that begin with the file format name. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Specifying File Formats to Open Open Classes Open Options Scripting Photoshop CS3 27 Photo CD Open Options Raw Format Open Options Camera Raw Open ...
Scripting Guide
Page 30
... Object Browser, look up the Preferences object to set application preferences in Windows versions of the settings properties you must indicate its containment in the Application object. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 30 Set docRef = appRef.Documents.Add() Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions") jpgSaveOptions.EmbedColorProfile = True jpgSaveOptions.FormatOptions = 1 'for psStandardBaseline jpgSaveOptions.Matte = 1 'for psNoMatte...
... Object Browser, look up the Preferences object to set application preferences in Windows versions of the settings properties you must indicate its containment in the Application object. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 30 Set docRef = appRef.Documents.Add() Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions") jpgSaveOptions.EmbedColorProfile = True jpgSaveOptions.FormatOptions = 1 'for psStandardBaseline jpgSaveOptions.Matte = 1 'for psNoMatte...
Scripting Guide
Page 32
...● VBS: Set fontsInstalled = AppRef.Fonts ● JS: var fontsInstalled = app.fonts ● The amount of unused memory available to Adobe Photoshop CS3, using the free memory (FreeMemory/freeMemory) property of the Application object. ● The location of the Preferences folder, using file Ducky.tif ...; Change the size of the document window (or canvas) to 4 inches high and 4 inches wide. ● Trim the top and bottom of the image. You can execute actions created either via scripting or using the Actions palette in Photoshop CS3. See 'Setting Application Preferences' on ...
...● VBS: Set fontsInstalled = AppRef.Fonts ● JS: var fontsInstalled = app.fonts ● The amount of unused memory available to Adobe Photoshop CS3, using the free memory (FreeMemory/freeMemory) property of the Application object. ● The location of the Preferences folder, using file Ducky.tif ...; Change the size of the document window (or canvas) to 4 inches high and 4 inches wide. ● Trim the top and bottom of the image. You can execute actions created either via scripting or using the Actions palette in Photoshop CS3. See 'Setting Application Preferences' on ...
Scripting Guide
Page 33
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 33 ● Crop the image. ● Flip the entire window. ● Restore the original ruler units. AS tell application "Adobe Photoshop CS3" set saveUnit to ruler units of settings set ruler units of settings to saveUnit end tell VBS Dim appRef, docRef Set appRef = CreateObject("Photoshop...ruler units of settings to inch units set duckFile to alias ¬ "OS X 10.4.8 US:Applications:Adobe Photoshop CS3:Samples:Ducky.tif" open duckFile set ruler units to current document resize image docRef width 4 height 4 resize...
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 33 ● Crop the image. ● Flip the entire window. ● Restore the original ruler units. AS tell application "Adobe Photoshop CS3" set saveUnit to ruler units of settings set ruler units of settings to saveUnit end tell VBS Dim appRef, docRef Set appRef = CreateObject("Photoshop...ruler units of settings to inch units set duckFile to alias ¬ "OS X 10.4.8 US:Applications:Adobe Photoshop CS3:Samples:Ducky.tif" open duckFile set ruler units to current document resize image docRef width 4 height 4 resize...
Scripting Guide
Page 46
....copyrighted = CopyrightedType.COPYRIGHTEDWORK docInfoRef.ownerUrl = "http://www.adobe.com" For information about other types of information (properties) you can associate with a document by selecting Window > History. Using History State Objects Photoshop CS3 keeps a history of the Document object. you can ...) object, which is stored in the info (Info/info) property of the actions that affect documents. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 46 AS set the copyrighted status and owner URL of a document. To accomplish this task in a script...
....copyrighted = CopyrightedType.COPYRIGHTEDWORK docInfoRef.ownerUrl = "http://www.adobe.com" For information about other types of information (properties) you can associate with a document by selecting Window > History. Using History State Objects Photoshop CS3 keeps a history of the Document object. you can ...) object, which is stored in the info (Info/info) property of the actions that affect documents. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 46 AS set the copyrighted status and owner URL of a document. To accomplish this task in a script...
Scripting Guide
Page 56
...classical type setting values, with 72.27 points per inch. The points and picas unit value types are used by Photoshop CS3 for a Photoshop CS3 property that your script. The traditional points and traditional picas unit value types are length units, representing values of the ...unit types for unit values. For example, if the ruler units are used. See 'Setting Ruler and Type Units in Windows. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 56 ● A type ruler, which is active when using the type units (TypeUnits/typeUnits) property. You set ...
...classical type setting values, with 72.27 points per inch. The points and picas unit value types are used by Photoshop CS3 for a Photoshop CS3 property that your script. The traditional points and traditional picas unit value types are length units, representing values of the ...unit types for unit values. For example, if the ruler units are used. See 'Setting Ruler and Type Units in Windows. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 56 ● A type ruler, which is active when using the type units (TypeUnits/typeUnits) property. You set ...
Scripting Guide
Page 60
... document preferences. ● Apply color to text items. In this section activate a Photoshop CS3 Application object and then save the script you have created in this section, you probably set up in Windows choose Edit > Preferences > Units & Rulers. Loads separate files into various file formats... of a layer by creating a selection object. ● Apply wave and motion blur filters to selected text. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 60 Script Name Layer Comps to Files.jsx Layer Comps to PDF.jsx Layer Comps to WPG.jsx Export Layers to...
... document preferences. ● Apply color to text items. In this section activate a Photoshop CS3 Application object and then save the script you have created in this section, you probably set up in Windows choose Edit > Preferences > Units & Rulers. Loads separate files into various file formats... of a layer by creating a selection object. ● Apply wave and motion blur filters to selected text. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 60 Script Name Layer Comps to Files.jsx Layer Comps to PDF.jsx Layer Comps to WPG.jsx Export Layers to...
Scripting Guide
Page 62
Create the following script. After viewing the document in Windows Explorer to theStartDisplayDialogs end tell 2. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 62 set new preferences and document defaults appRef.Preferences.RulerUnits = 2 'for PsUnits --> 2 (psInches) appRef.Preferences.TypeUnits = 1 'for PsTypeUnits --> 1 (psPixels) appRef.DisplayDialogs = 3 'for default preferences, new ...
Create the following script. After viewing the document in Windows Explorer to theStartDisplayDialogs end tell 2. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 62 set new preferences and document defaults appRef.Preferences.RulerUnits = 2 'for PsUnits --> 2 (psInches) appRef.Preferences.TypeUnits = 1 'for PsTypeUnits --> 1 (psPixels) appRef.DisplayDialogs = 3 'for default preferences, new ...
Scripting Guide
Page 68
...Selection class: Select method Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 68 Note: Look up the following classes in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser to see if you understand how you used them in Windows Explorer to run the script.... 3. Note: Look up the following classes in the Adobe Photoshop CS3 AppleScript Scripting Reference, or in the Photoshop CS3 AppleScript Dictionary to see if you understand how you...
...Selection class: Select method Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 68 Note: Look up the following classes in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser to see if you understand how you used them in Windows Explorer to run the script.... 3. Note: Look up the following classes in the Adobe Photoshop CS3 AppleScript Scripting Reference, or in the Photoshop CS3 AppleScript Dictionary to see if you understand how you...
Scripting Guide
Page 70
..., docHeightInPixels), _ Array(docWidthInPixels / 2, docHeightInPixels), _ Array(docWidthInPixels / 2, 0)) newTextLayer.ApplyMotionBlur 45, 5 docRef.Selection.Deselect 2. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 70 set theSelRegion to {{theDocWidthInPixels / 2, 0},¬ {theDocWidthInPixels, 0}, ¬ {theDocWidthInPixels, theDocHeightInPixels}, ¬ {theDocWidthInPixels / 2,...10148; To apply a motionblur filter to HelloWorldDoc: 1. Double click on the file in Windows Explorer to run the script. Choose Run to run the script. Type the following ...
..., docHeightInPixels), _ Array(docWidthInPixels / 2, docHeightInPixels), _ Array(docWidthInPixels / 2, 0)) newTextLayer.ApplyMotionBlur 45, 5 docRef.Selection.Deselect 2. Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 70 set theSelRegion to {{theDocWidthInPixels / 2, 0},¬ {theDocWidthInPixels, 0}, ¬ {theDocWidthInPixels, theDocHeightInPixels}, ¬ {theDocWidthInPixels / 2,...10148; To apply a motionblur filter to HelloWorldDoc: 1. Double click on the file in Windows Explorer to run the script. Choose Run to run the script. Type the following ...
Scripting Guide
Page 72
... VBScript code (Windows only). Select the file ScriptListener.8li and then choose Edit > Copy. 2. This will not only create large files that represents the actions taken in scripts using the Actions palette. You create and run actions in the ..\Adobe Photoshop CS3\Scripting Guide\Utilities... folder. ➤ To install the ScriptListener: 1. Note: If Photoshop CS3 is located in the application interface using a utility called the Action Manager. You...
... VBScript code (Windows only). Select the file ScriptListener.8li and then choose Edit > Copy. 2. This will not only create large files that represents the actions taken in scripts using the Actions palette. You create and run actions in the ..\Adobe Photoshop CS3\Scripting Guide\Utilities... folder. ➤ To install the ScriptListener: 1. Note: If Photoshop CS3 is located in the application interface using a utility called the Action Manager. You...
Scripting Guide
Page 73
... a script log file using . To prevent the ScriptingListenerJS.log file from your desktop. Open Photoshop CS3, then open a document. 2. Close Photoshop CS3. 2. Using the following location: ..\Adobe Photoshop CS\Plug-Ins\Automate 4. Note: In Windows, even though you begin the following procedure. Choose Window > Actions, then choose New Action from the Automate folder, it each time you are...
... a script log file using . To prevent the ScriptingListenerJS.log file from your desktop. Open Photoshop CS3, then open a document. 2. Close Photoshop CS3. 2. Using the following location: ..\Adobe Photoshop CS\Plug-Ins\Automate 4. Note: In Windows, even though you begin the following procedure. Choose Window > Actions, then choose New Action from the Automate folder, it each time you are...