Adobe 23101764 Scripting Guide - Page 69
appRef.ActiveDocument = appRef.DocumentsMy Document
UPC - 718659340025
View all Adobe 23101764 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 69 highlights
Scripting Photoshop 3 The Application object AS: set docRef to current document VB: Set docRef = appRef.ActiveDocument JS: docRef = app.activeDocument; You can also switch back and forth between documents by setting the active document. AS: set current document to document "My Document" VB: appRef.ActiveDocument = appRef.Documents("My Document") JS: app.activeDocument = app.documents["My Document"]; Application preferences The application object contains a property for Photoshop preferences. The preferences property is itself an object and has many properties. The name of the preferences object for the three languages is the following: AS: settings VB: Preferences JS: preferences The properties in the preferences object correlate to the preferences found by displaying the Photoshop "Preferences" dialog in the user interface (select the "Edit > Preferences" menu in Photoshop). Display dialogs It is important to be able to control dialogs properly from a script. If a dialog is shown your script stops until a user dismisses the dialog. This is normally fine in an interactive script that expects a user to be sitting at the machine. But if you have a script that runs in an unsupervised (batch) mode you do not want dialogs to be displayed and stop your script. Using the display dialogs (DisplayDialogs/displayDialogs) property on the application object you can control whether or not dialogs are displayed. If you set display dialogs to always ( psDisplayAllDialogs/ALL ), Photoshop will show all user related dialogs. This is typically not what you want. If you set display dialogs to error dialogs (DisplayErrorDialogs/ERROR), then only dialogs related to errors are shown. You would typically use this setting when you are developing a script or if your script is an interactive one that expects a user to be sitting at the machine while running the script. If you set display dialogs to never ( DisplayNoDialogs/NO ), then no dialogs are shown. If an error occurs it will be returned as an error to the script. See section 2.10.4, "Error handling" on page 29 for more information on catching errors. Photoshop CS Scripting Guide 65