Application
The Adobe Photoshop application object.
This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. For example: var currentDoc = app.activeDocument;
QuickLinks
Hierarchy
Properties
Property | Type | Access | Description |
---|---|---|---|
activeDocument | Document | r/w | The frontmost document. |
backgroundColor | SolidColor | r/w | The default background color (used to paint, fill, and stroke selections). |
build | string | readonly | The build number. |
colorSettings | any | r/w | The name of the selected color setting's set. |
displayDialogs | DialogModes: DialogModes.ALL DialogModes.ERROR DialogModes.NO |
r/w | The dialog mode for the document, which indicates whether or not Photoshop displays dialogs when the script runs. |
documents | Documents Document | readonly | The collection of open documents. |
fonts | TextFonts TextFont | readonly | The fonts installed on this system. |
foregroundColor | SolidColor | r/w | The default foreground color (used to paint, fill, and stroke selections). |
freeMemory | number | readonly | The amount of unused memory available to Photoshop. |
locale | string | readonly | The language locale of the application. |
macintoshFileTypes | Array of string | readonly | A list of the image file types Photoshop can open. |
measurementLog | MeasurementLog | readonly | The log of measurements taken. |
name | string | readonly | The application name. |
notifiers | Notifiers Notifier | readonly | The notifiers currently configured (in the Scripts Events Manager menu in the application). |
notifiersEnabled | bool | r/w | If true, notifiers are enabled. |
parent | Object | readonly | The object's container. |
path | Folder | readonly | The full path of the location of the Adobe Photoshop application. |
playbackDisplayDialogs | DialogModes: DialogModes.ALL DialogModes.ERROR DialogModes.NO |
r/w | The dialog mode for playback mode, which indicates whether or not Photoshop displays dialogs in playback mode. |
playbackParameters | ActionDescriptor | r/w | The playback options, which indicate the speed at which Photoshop plays actions. |
preferences | Preferences | readonly | The application preference settings (equivalent to selecting Edit > Preferences in the Adobe Photoshop application in Windows or Photoshop > Preferences in Mac OS). |
preferencesFolder | File | readonly | The full path to the preferences folder. |
recentFiles | FileArray | readonly | Files in the Recent Files list. |
scriptingBuildDate | string | readonly | The build date of the scripting interface. |
scriptingVersion | string | readonly | The version of the Scripting interface. |
systemInformation | string | readonly | The system and applicaiton information. |
typename | string | readonly | The class name of the object. |
version | string | readonly | The version of Adobe Photoshop application that you are running. |
windowsFileTypes | Array of string | readonly | A list of the image file extensions Photoshop can open. |
Methods
Instances
string batch (inputFiles:
AliasArray, action:
string, from:
string[, options:
BatchOptions])
Runs the batch automation routine; analogous to using the Batch command in Photoshop.
Parameter | Type | Description |
---|---|---|
inputFiles | AliasArray | The files to operate on. |
action | string | The name of the action to play (note that the Action name is case-sensitive and must match the name in the Actions palette). |
from | string | The name of the action set containing the action being played (note that the Action Set name is case-sensitive and must match the name in the Actions palette). |
options | BatchOptions | Options for batch automation. (Optional) |
void bringToFront ()
Makes Photoshop the active application.
int charIDToTypeID (charID:
string)
Converts from a four character code to a runtime ID.
Parameter | Type | Description |
---|---|---|
charID | string | The ID to convert. |
void doAction (action:
string, from:
string)
Plays the specified action from the Actions palette.
Parameter | Type | Description |
---|---|---|
action | string | The name of the action to play. (Note that the action name is case-sensitive and must match the name as it appears in the Actions palette.) |
from | string | The name of the action set containing the action being played. (Note that the Action Set name is case-sensitive and must match the name as it appears in the Actions palette.) |
void eraseCustomOptions (key:
string)
Removes the specified user objects from the Photoshop registry.
Parameter | Type | Description |
---|---|---|
key | string | The unique string ID for user object(s) to remove. |
ActionDescriptor executeAction (eventID:
int[, descriptor:
ActionDescriptor][, displayDialogs:
DialogModes])
Plays an ActionManager event.
Parameter | Type | Description |
---|---|---|
eventID | int | The event to play. |
descriptor | ActionDescriptor | The action descriptor to play. (Optional) |
displayDialogs | DialogModes: DialogModes.ALL DialogModes.ERROR DialogModes.NO | The display permissions for dialogs and alert messages. (Optional) |
ActionDescriptor executeActionGet (reference:
ActionReference)
Obtains an action descriptor.
Parameter | Type | Description |
---|---|---|
reference | ActionReference | The reference specification of the property. |
bool featureEnabled (name:
string)
If true, the specified feature is enabled.
Parameter | Type | Description |
---|---|---|
name | string | The name of the feature. |
ActionDescriptor getCustomOptions (key:
string)
Retrieves user objects from the Photoshop registry for the ID with value key.
Parameter | Type | Description |
---|---|---|
key | string | The unique string ID for the user object. |
void load (document:
File)
Loads a support document.
Parameter | Type | Description |
---|---|---|
document | File | The document to load. |
string makeContactSheet (inputFiles:
AliasArray[, options:
ContactSheetOptions])
Creates a contact sheet from multiple files.
Parameter | Type | Description |
---|---|---|
inputFiles | AliasArray | The files to include. |
options | ContactSheetOptions | Options for creating the contact sheet. (Optional) |
string makePDFPresentation (inputFiles:
AliasArray, outputFile:
File[, options:
PresentationOptions])
Creates a PDF presentation file.
Parameter | Type | Description |
---|---|---|
inputFiles | AliasArray | The input files to include in the presentation. |
outputFile | File | The location of the output file. |
options | PresentationOptions | Options for the PDF presentation. (Optional) |
string makePhotoGallery (inputFolder:
any, outputFolder:
File[, options:
GalleryOptions])
Deprecated for Adobe Photoshop CS3. Creates a web photo gallery.
Parameter | Type | Description |
---|---|---|
inputFolder | any | Folder to process or an array of files to process. |
outputFolder | File | Location for output files. |
options | GalleryOptions | Options for the web photo gallery. (Optional) |
string makePhotomerge (inputFiles:
AliasArray)
Deprecated for Adobe Photoshop CS3. Merges multiple files into one, user interaction required.
Parameter | Type | Description |
---|---|---|
inputFiles | AliasArray | List of input files to include. |
string makePicturePackage (inputFiles:
AliasArray[, options:
PicturePackageOptions])
Creates a picture package from multiple files.
Parameter | Type | Description |
---|---|---|
inputFiles | AliasArray | The files to include. |
options | PicturePackageOptions | Options for creating a Picture Package. (Optional) |
Document open (document:
File[, as:
any][, asSmartObject:
bool=false])
Opens the specified document file(s).
Parameter | Type | Description |
---|---|---|
document | File | The document(s) to opend. |
as | any | The document type (The default is to let Photoshop deduce the format). (Optional) |
asSmartObject | bool | Creates a smart object around the document. (default: false) (Optional) |
FileArray openDialog ()
Uses the Photoshop open dialog to select files.
void purge (target:
PurgeTarget)
Purges one or more caches.
Parameter | Type | Description |
---|---|---|
target | PurgeTarget: PurgeTarget.UNDOCACHES PurgeTarget.HISTORYCACHES PurgeTarget.CLIPBOARDCACHE PurgeTarget.ALLCACHES | The caches to purge. |
void putCustomOptions (key:
string, customObject:
ActionDescriptor[, persistent:
bool=true])
Saves user objects in the Photoshop registry.
Parameter | Type | Description |
---|---|---|
key | string | The unique string ID for the user object. |
customObject | ActionDescriptor | The user-defined custom object to save in the registry. |
persistent | bool | If true, the object persists after the script has finished. (default: true) (Optional) |
void refresh ()
Pauses the script until the application refreshes.
int runMenuItem ()
Run a menu item with the given ID. Use this for Insert Menu Item.
int stringIDToTypeID (stringID:
string)
Converts from a string ID to a runtime ID.
Parameter | Type | Description |
---|---|---|
stringID | string | The ID to convert. |
void togglePalettes ()
Toggle palette visibility.
string typeIDToCharID (typeID:
int)
Converts from a runtime ID to a character ID.
Parameter | Type | Description |
---|---|---|
typeID | int | The ID to convert. |
string typeIDToStringID (typeID:
int)
Converts from a runtime ID to a string ID.
Parameter | Type | Description |
---|---|---|
typeID | int | The ID to convert. |
Element of
global.app
Jongware, 28-Aug-2012 v3.0.3i | Contents :: Index |