Packagecom.adobe.photoshop
Classpublic class Application
InheritanceApplication Inheritance PhotoshopHostObject Inheritance CSHostObject Inheritance flash.utils.Proxy

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;



Public Properties
 PropertyDefined By
  activeDocument : Document
The frontmost document.
Application
  backgroundColor : SolidColor
The default background color (used to paint, fill, and stroke selections).
Application
  build : String
[read-only] The build number.
Application
  colorSettings : Object
The name of the selected color setting's set.
Application
  displayDialogs : DialogModes
The dialog mode for the document, which indicates whether or not Photoshop displays dialogs when the script runs.
Application
  documents : Documents
[read-only] The collection of open documents.
Application
  fonts : TextFonts
[read-only] The fonts installed on this system.
Application
  foregroundColor : SolidColor
The default foreground color (used to paint, fill, and stroke selections).
Application
  freeMemory : Number
[read-only] The amount of unused memory available to Photoshop.
Application
 InheritedhostObjectDelegate : HostObject
Getter for the delegate
CSHostObject
  locale : String
[read-only] The language locale of the application.
Application
  macintoshFileTypes : Array
[read-only] A list of the image file types Photoshop can open.
Application
  measurementLog : MeasurementLog
[read-only] The log of measurements taken.
Application
  name : String
[read-only] The application name.
Application
  notifiers : Notifiers
[read-only] The notifiers currently configured (in the Scripts Events Manager menu in the application).
Application
  notifiersEnabled : Boolean
If true, notifiers are enabled.
Application
 Inheritedparent : *
[read-only]
PhotoshopHostObject
  path : File
[read-only] The full path of the location of the Adobe Photoshop application.
Application
  playbackDisplayDialogs : DialogModes
The dialog mode for playback mode, which indicates whether or not Photoshop displays dialogs in playback mode.
Application
  playbackParameters : ActionDescriptor
The playback options, which indicate the speed at which Photoshop plays actions.
Application
  preferences : Preferences
[read-only] The application preference settings (equivalent to selecting Edit > Preferences in the Adobe Photoshop application in Windows or Photoshop > Preferences in Mac OS).
Application
  preferencesFolder : File
[read-only] The full path to the preferences folder.
Application
  recentFiles : Array
[read-only] Files in the Recent Files list.
Application
  scriptingBuildDate : String
[read-only] The build date of the scripting interface.
Application
  scriptingVersion : String
[read-only] The version of the Scripting interface.
Application
  systemInformation : String
[read-only] The system and applicaiton information.
Application
  version : String
[read-only] The version of Adobe Photoshop application that you are running.
Application
  windowsFileTypes : Array
[read-only] A list of the image file extensions Photoshop can open.
Application
Public Methods
 MethodDefined By
  
batch(inputFiles:Object, action:String, from:String, options:BatchOptions = null):String
Runs the batch automation routine; analogous to using the Batch command in Photoshop.
Application
  
beep():void
Alerts the user.
Application
  
Makes Photoshop the active application.
Application
  
charIDToTypeID(charID:String):Number
Converts from a four character code to a runtime ID.
Application
  
doAction(action:String, from:String):void
Plays the specified action from the Actions palette.
Application
  
eraseCustomOptions(key:String):void
Removes the specified user objects from the Photoshop registry.
Application
  
executeAction(eventID:Number, descriptor:ActionDescriptor = null, displayDialogs:DialogModes = null):ActionDescriptor
Plays an ActionManager event.
Application
  
Obtains an action descriptor.
Application
  
featureEnabled(name:String):Boolean
If true, the specified feature is enabled.
Application
 Inherited
filterArgsForHBAPI(args:Array):Array
[static] Function to clean up the argument list and put it into a format that makes sense for HBAPI.
CSHostObject
 Inherited
filterSingleObjectForHBAPI(value:Object):Object
[static]
CSHostObject
 Inherited
getClassObjectForName(className:String):HostObject
[static] This returns a "Class" object, meaning, a HostObject that can be used to make static function calls or get static properties
CSHostObject
  
Retrieves user objects from the Photoshop registry for the ID with value key.
Application
 Inherited
getSpecialTranslation(className:String, ho:HostObject, expectedReturnType:Class, ownerName:String):*
[static]
CSHostObject
 Inherited
hostCall(name:String, expectedReturnType:Class, rawargs:Array):*
Encapsulates a function call to the host
CSHostObject
 Inherited
hostCallStatic(className:String, methodName:String, expectedReturnType:Class, rawargs:Array):*
[static] Implements a safe call of a static method on the host
CSHostObject
 Inherited
hostGet(name:String, expectedReturnType:Class):*
Encapsulates a property get to the host
CSHostObject
 Inherited
hostGetIndex(idx:Object, expectedReturnType:Class):*
Encapsulates a indexed get to the host
CSHostObject
 Inherited
hostGetStatic(className:String, propertyName:String, expectedReturnType:Class):*
[static] Implements a safe get of a static property on the host Used by for instance, all the enum implementations.
CSHostObject
 Inherited
hostSet(name:String, rawvalue:*):void
Encapsulates a property set to the host
CSHostObject
 Inherited
hostSetStatic(className:String, propertyName:String, rawvalue:*):*
[static] Implements a safe set of a static property on the host
CSHostObject
 Inherited
isDescendedFrom(clz:Class, ancClass:Class):Boolean
[static] Efficiently determines whether or not one class descends from another in inheritance hierarchy- class relationships are cached by the ClassUtils implementation- (uses org.as3commons lib to quickly discover class hierarchy.
CSHostObject
  
returns true if Quicktime is installed
Application
  
load(document:File):void
Loads a support document.
Application
  
makeContactSheet(inputFiles:Object, options:ContactSheetOptions = null):String
Creates a contact sheet from multiple files.
Application
  
makePDFPresentation(inputFiles:Object, outputFile:File, options:PresentationOptions = null):String
Creates a PDF presentation file.
Application
  
makePhotoGallery(inputFolder:Object, outputFolder:File, options:GalleryOptions = null):String
Deprecated for Adobe Photoshop CS3.
Application
  
makePhotomerge(inputFiles:Object):String
Deprecated for Adobe Photoshop CS3.
Application
  
makePicturePackage(inputFiles:Object, options:PicturePackageOptions = null):String
Creates a picture package from multiple files.
Application
  
open(document:File, _as:Object = null, asSmartObject:Boolean = false):Document
Opens the specified document file(s).
Application
  
openDialog():Object
Uses the Photoshop open dialog to select files.
Application
  
purge(target:PurgeTarget):void
Purges one or more caches.
Application
  
putCustomOptions(key:String, customObject:ActionDescriptor, persistent:Boolean = true):void
Saves user objects in the Photoshop registry.
Application
  
refresh():void
Pauses the script until the application refreshes.
Application
  
force the font list to get refreshed
Application
 Inherited
replaceDefaultArgs(args:Array, defaultArgs:Array):Array
Function to tidy up arguments prior to call.
CSHostObject
  
runMenuItem(menuID:Number):void
Run a menu item with the given ID.
Application
  
showColorPicker(pickForeground:Boolean = true):Boolean
display color picker dialog.
Application
  
stringIDToTypeID(stringID:String):Number
Converts from a string ID to a runtime ID.
Application
  
system(callString:String):Number
perform a system call
Application
  
Toggle palette visibility.
Application
  
typeIDToCharID(typeID:Number):String
Converts from a runtime ID to a character ID.
Application
  
typeIDToStringID(typeID:Number):String
Converts from a runtime ID to a string ID.
Application
 Inherited
wrapReturnedHostObject(rawObject:Object, expectedReturnType:Class, client:CSHostObject, propertyName:String):*
[static] Method used on static/normal get/ hostcalls
CSHostObject
Protected Methods
 MethodDefined By
 Inherited
createWithArgs(args:Array):void
CSHostObject
 Inherited
hostCreate(args:Array):void
CSHostObject
Property Detail
activeDocumentproperty
activeDocument:Document

The frontmost document.


Implementation
    public function get activeDocument():Document
    public function set activeDocument(value:Document):void
backgroundColorproperty 
backgroundColor:SolidColor

The default background color (used to paint, fill, and stroke selections).


Implementation
    public function get backgroundColor():SolidColor
    public function set backgroundColor(value:SolidColor):void
buildproperty 
build:String  [read-only]

The build number.


Implementation
    public function get build():String
colorSettingsproperty 
colorSettings:Object

The name of the selected color setting's set.


Implementation
    public function get colorSettings():Object
    public function set colorSettings(value:Object):void
displayDialogsproperty 
displayDialogs:DialogModes

The dialog mode for the document, which indicates whether or not Photoshop displays dialogs when the script runs.


Implementation
    public function get displayDialogs():DialogModes
    public function set displayDialogs(value:DialogModes):void
documentsproperty 
documents:Documents  [read-only]

The collection of open documents.


Implementation
    public function get documents():Documents
fontsproperty 
fonts:TextFonts  [read-only]

The fonts installed on this system.


Implementation
    public function get fonts():TextFonts
foregroundColorproperty 
foregroundColor:SolidColor

The default foreground color (used to paint, fill, and stroke selections).


Implementation
    public function get foregroundColor():SolidColor
    public function set foregroundColor(value:SolidColor):void
freeMemoryproperty 
freeMemory:Number  [read-only]

The amount of unused memory available to Photoshop.


Implementation
    public function get freeMemory():Number
localeproperty 
locale:String  [read-only]

The language locale of the application.


Implementation
    public function get locale():String
macintoshFileTypesproperty 
macintoshFileTypes:Array  [read-only]

A list of the image file types Photoshop can open.


Implementation
    public function get macintoshFileTypes():Array
measurementLogproperty 
measurementLog:MeasurementLog  [read-only]

The log of measurements taken.


Implementation
    public function get measurementLog():MeasurementLog
nameproperty 
name:String  [read-only]

The application name.


Implementation
    public function get name():String
notifiersproperty 
notifiers:Notifiers  [read-only]

The notifiers currently configured (in the Scripts Events Manager menu in the application).


Implementation
    public function get notifiers():Notifiers
notifiersEnabledproperty 
notifiersEnabled:Boolean

If true, notifiers are enabled.


Implementation
    public function get notifiersEnabled():Boolean
    public function set notifiersEnabled(value:Boolean):void
pathproperty 
path:File  [read-only]

The full path of the location of the Adobe Photoshop application.


Implementation
    public function get path():File
playbackDisplayDialogsproperty 
playbackDisplayDialogs:DialogModes

The dialog mode for playback mode, which indicates whether or not Photoshop displays dialogs in playback mode.


Implementation
    public function get playbackDisplayDialogs():DialogModes
    public function set playbackDisplayDialogs(value:DialogModes):void
playbackParametersproperty 
playbackParameters:ActionDescriptor

The playback options, which indicate the speed at which Photoshop plays actions.


Implementation
    public function get playbackParameters():ActionDescriptor
    public function set playbackParameters(value:ActionDescriptor):void
preferencesproperty 
preferences:Preferences  [read-only]

The application preference settings (equivalent to selecting Edit > Preferences in the Adobe Photoshop application in Windows or Photoshop > Preferences in Mac OS).


Implementation
    public function get preferences():Preferences
preferencesFolderproperty 
preferencesFolder:File  [read-only]

The full path to the preferences folder.


Implementation
    public function get preferencesFolder():File
recentFilesproperty 
recentFiles:Array  [read-only]

Files in the Recent Files list.


Implementation
    public function get recentFiles():Array
scriptingBuildDateproperty 
scriptingBuildDate:String  [read-only]

The build date of the scripting interface.


Implementation
    public function get scriptingBuildDate():String
scriptingVersionproperty 
scriptingVersion:String  [read-only]

The version of the Scripting interface.


Implementation
    public function get scriptingVersion():String
systemInformationproperty 
systemInformation:String  [read-only]

The system and applicaiton information.


Implementation
    public function get systemInformation():String
versionproperty 
version:String  [read-only]

The version of Adobe Photoshop application that you are running.


Implementation
    public function get version():String
windowsFileTypesproperty 
windowsFileTypes:Array  [read-only]

A list of the image file extensions Photoshop can open.


Implementation
    public function get windowsFileTypes():Array
Method Detail
batch()method
public function batch(inputFiles:Object, action:String, from:String, options:BatchOptions = null):String

Runs the batch automation routine; analogous to using the Batch command in Photoshop.

Parameters

inputFiles:Object — (Object) The files to operate on.
 
action:String — (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 — (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 (default = null) — (com.adobe.photoshop.BatchOptions) Options for batch automation.

Returns
String
beep()method 
public function beep():void

Alerts the user.

bringToFront()method 
public function bringToFront():void

Makes Photoshop the active application.

charIDToTypeID()method 
public function charIDToTypeID(charID:String):Number

Converts from a four character code to a runtime ID.

Parameters

charID:String — (String) The ID to convert.

Returns
Number
doAction()method 
public function doAction(action:String, from:String):void

Plays the specified action from the Actions palette.

Parameters

action:String — (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 — (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.)

eraseCustomOptions()method 
public function eraseCustomOptions(key:String):void

Removes the specified user objects from the Photoshop registry.

Parameters

key:String — (String) The unique string ID for user object(s) to remove.

executeAction()method 
public function executeAction(eventID:Number, descriptor:ActionDescriptor = null, displayDialogs:DialogModes = null):ActionDescriptor

Plays an ActionManager event.

Parameters

eventID:Number — (Number) The event to play.
 
descriptor:ActionDescriptor (default = null) — (com.adobe.photoshop.ActionDescriptor) The action descriptor to play.
 
displayDialogs:DialogModes (default = null) — (com.adobe.photoshop.DialogModes) The display permissions for dialogs and alert messages.

Returns
ActionDescriptor
executeActionGet()method 
public function executeActionGet(reference:ActionReference):ActionDescriptor

Obtains an action descriptor.

Parameters

reference:ActionReference — (com.adobe.photoshop.ActionReference) The reference specification of the property.

Returns
ActionDescriptor
featureEnabled()method 
public function featureEnabled(name:String):Boolean

If true, the specified feature is enabled.

Parameters

name:String — (String) The name of the feature.

Returns
Boolean
getCustomOptions()method 
public function getCustomOptions(key:String):ActionDescriptor

Retrieves user objects from the Photoshop registry for the ID with value key.

Parameters

key:String — (String) The unique string ID for the user object.

Returns
ActionDescriptor
isQuicktimeAvailable()method 
public function isQuicktimeAvailable():Boolean

returns true if Quicktime is installed

Returns
Boolean
load()method 
public function load(document:File):void

Loads a support document.

Parameters

document:File — (flash.filesystem.File) The document to load.

makeContactSheet()method 
public function makeContactSheet(inputFiles:Object, options:ContactSheetOptions = null):String

Creates a contact sheet from multiple files.

Parameters

inputFiles:Object — (Object) The files to include.
 
options:ContactSheetOptions (default = null) — (com.adobe.photoshop.ContactSheetOptions) Options for creating the contact sheet.

Returns
String
makePDFPresentation()method 
public function makePDFPresentation(inputFiles:Object, outputFile:File, options:PresentationOptions = null):String

Creates a PDF presentation file.

Parameters

inputFiles:Object — (Object) The input files to include in the presentation.
 
outputFile:File — (flash.filesystem.File) The location of the output file.
 
options:PresentationOptions (default = null) — (com.adobe.photoshop.PresentationOptions) Options for the PDF presentation.

Returns
String
makePhotoGallery()method 
public function makePhotoGallery(inputFolder:Object, outputFolder:File, options:GalleryOptions = null):String

Deprecated for Adobe Photoshop CS3. Creates a web photo gallery.

Parameters

inputFolder:Object — (Object) Folder to process or an array of files to process.
 
outputFolder:File — (flash.filesystem.File) Location for output files.
 
options:GalleryOptions (default = null) — (com.adobe.photoshop.GalleryOptions) Options for the web photo gallery.

Returns
String
makePhotomerge()method 
public function makePhotomerge(inputFiles:Object):String

Deprecated for Adobe Photoshop CS3. Merges multiple files into one, user interaction required.

Parameters

inputFiles:Object — (Object) List of input files to include.

Returns
String
makePicturePackage()method 
public function makePicturePackage(inputFiles:Object, options:PicturePackageOptions = null):String

Creates a picture package from multiple files.

Parameters

inputFiles:Object — (Object) The files to include.
 
options:PicturePackageOptions (default = null) — (com.adobe.photoshop.PicturePackageOptions) Options for creating a Picture Package.

Returns
String
open()method 
public function open(document:File, _as:Object = null, asSmartObject:Boolean = false):Document

Opens the specified document file(s).

Parameters

document:File — (flash.filesystem.File) The document(s) to opend.
 
_as:Object (default = null) — (Object) The document type (The default is to let Photoshop deduce the format).
 
asSmartObject:Boolean (default = false) — (Boolean) Creates a smart object around the document. ( default: false )

Returns
Document
openDialog()method 
public function openDialog():Object

Uses the Photoshop open dialog to select files.

Returns
Object
purge()method 
public function purge(target:PurgeTarget):void

Purges one or more caches.

Parameters

target:PurgeTarget — (com.adobe.photoshop.PurgeTarget) The caches to purge.

putCustomOptions()method 
public function putCustomOptions(key:String, customObject:ActionDescriptor, persistent:Boolean = true):void

Saves user objects in the Photoshop registry.

Parameters

key:String — (String) The unique string ID for the user object.
 
customObject:ActionDescriptor — (com.adobe.photoshop.ActionDescriptor) The user-defined custom object to save in the registry.
 
persistent:Boolean (default = true) — (Boolean) If true, the object persists after the script has finished. ( default: true )

refresh()method 
public function refresh():void

Pauses the script until the application refreshes.

refreshFonts()method 
public function refreshFonts():void

force the font list to get refreshed

runMenuItem()method 
public function runMenuItem(menuID:Number):void

Run a menu item with the given ID. Use this for Insert Menu Item.

Parameters

menuID:Number — (Number) id of menu to run

showColorPicker()method 
public function showColorPicker(pickForeground:Boolean = true):Boolean

display color picker dialog. Returns false if dialog is cancelled, true otherwise

Parameters

pickForeground:Boolean (default = true) — (Boolean) if true the foreground color is chosen, if false the background color is chosen ( default: true )

Returns
Boolean
stringIDToTypeID()method 
public function stringIDToTypeID(stringID:String):Number

Converts from a string ID to a runtime ID.

Parameters

stringID:String — (String) The ID to convert.

Returns
Number
system()method 
public function system(callString:String):Number

perform a system call

Parameters

callString:String — (String) system call string

Returns
Number
togglePalettes()method 
public function togglePalettes():void

Toggle palette visibility.

typeIDToCharID()method 
public function typeIDToCharID(typeID:Number):String

Converts from a runtime ID to a character ID.

Parameters

typeID:Number — (Number) The ID to convert.

Returns
String
typeIDToStringID()method 
public function typeIDToStringID(typeID:Number):String

Converts from a runtime ID to a string ID.

Parameters

typeID:Number — (Number) The ID to convert.

Returns
String