The Adobe Photoshop application object, which contains all other Adobe Photoshop objects.
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;
Go to Property Listing | Method Listing
toolSupportsBrushes, saveToolBrushToFile, applyToolBrushFromFile, thumbnailStyleFile, thumbnailText, doProgress, doForcedProgress, changeProgressText, doProgressTask, doProgressSegmentTask, doProgressSubTask, updateProgress, togglePalettes, doAction, load, open, purge, makePhotoGallery, makePDFPresentation, makePhotomerge, makeContactSheet, makePicturePackage, batch, bringToFront, refresh, refreshFonts, putCustomOptions, getCustomOptions, eraseCustomOptions, featureEnabled, openDialog, runMenuItem, system, executeAction, executeActionGet, stringIDToTypeID, typeIDToStringID, charIDToTypeID, typeIDToCharID, beep, isQuicktimeAvailable, showColorPicker
ActionDescriptor, Boolean, DialogModes, Document, Documents, File, MeasurementLog, Notifiers, Number, Preferences, SolidColor, String, TextFonts,
Property |
Type |
Access |
Description |
---|---|---|---|
read/write |
The frontmost document. |
||
read/write |
The default background color (used to paint, fill, and stroke selections). |
||
readonly |
The build number of Adobe Photoshop application. |
||
Varies |
read/write |
The name of the selected color setting's set. |
|
read/write |
Name of the current tool. |
||
read/write |
The dialog mode for the document, which indicates whether or not Photoshop displays dialogs when the script runs. |
||
readonly |
The collection of open documents. |
||
readonly |
The fonts installed on this system. |
||
read/write |
The default foreground color (used to paint, fill, and stroke selections). |
||
readonly |
The amount of unused memory available to Photoshop. |
||
readonly |
The language locale of the application. |
||
readonly |
A list of the image file types Photoshop can open. |
||
readonly |
The log of measurements taken. |
||
readonly |
The application name. |
||
readonly |
The notifiers currently configured (in the Scripts Events Manager menu in the application). |
||
read/write |
If true, notifiers are enabled. |
||
readonly |
The object's container. |
||
readonly |
The full path of the location of the Adobe Photoshop application. |
||
read/write |
The dialog mode for playback mode, which indicates whether or not Photoshop displays dialogs in playback mode. |
||
read/write |
The playback options, which indicate the speed at which Photoshop plays actions. |
||
readonly |
The application preference settings (equivalent to selecting Edit > Preferences in the Adobe Photoshop application in Windows or Photoshop > Preferences in Mac OS). |
||
readonly |
The full path to the preferences folder. |
||
FileArray |
readonly |
Files in the Recent Files list. |
|
readonly |
The build date of the scripting interface. |
||
readonly |
The version of the Scripting interface. |
||
readonly |
System information of the host application and machine. |
||
readonly |
The class name of the object. |
||
readonly |
The version of Adobe Photoshop application that you are running. |
||
readonly |
A list of the image file extensions Photoshop can open. |
undefined applyToolBrushFromFile (file:File)
PRIVATE - set the current tool brush from a file.
Parameter |
Type |
Description |
---|---|---|
file |
Brush file to apply. |
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 |
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 |
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 |
Options for batch automation. |
undefined beep ()
Alerts the user.
undefined bringToFront ()
Makes Photoshop the active application.
undefined changeProgressText (progressString:String)
Changes the text that appears in the progress window.
Parameter |
Type |
Description |
---|---|---|
progressString |
String to show in the progress window. |
Int charIDToTypeID (charID:String)
Converts from a four character code to a runtime ID.
Parameter |
Type |
Description |
---|---|---|
charID |
The ID to convert. |
undefined doAction (action:String, from:String)
Plays the specified action from the Actions palette.
Parameter |
Type |
Description |
---|---|---|
action |
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 |
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.) |
undefined doForcedProgress (progressString:String, javaScriptString:String)
Performs a task with a progress bar. Forces progress bar to display, ignoring the normal heuristics that keep it from showing unnecessarily (e.g. during very short tasks). Other progress APIs must be called periodically to update the progress bar and allow cancelling.
Parameter |
Type |
Description |
---|---|---|
progressString |
String to show in the progress window. |
|
javaScriptString |
JavaScriptString to execute. |
undefined doProgress (progressString:String, javaScriptString:String)
Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling.
Parameter |
Type |
Description |
---|---|---|
progressString |
String to show in the progress window. |
|
javaScriptString |
JavaScriptString to execute. |
Boolean doProgressSegmentTask (segmentLength:Int, done:Int, total:Int, javaScriptString:String)
Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. Use when iterating a list of tasks with unequal run times.
Parameter |
Type |
Description |
---|---|---|
segmentLength |
Int |
The length of the current task. |
done |
Int |
The total length of all completed tasks. |
total |
Int |
The total length of all tasks. |
javaScriptString |
JavaScriptString to execute. |
Boolean doProgressSubTask (index:Int, limit:Int, javaScriptString:String)
Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. Use when iterating a simple list of tasks with equal run times.
Parameter |
Type |
Description |
---|---|---|
index |
Int |
The 0-based index of the current task. |
limit |
Int |
The total number of tasks. |
javaScriptString |
JavaScriptString to execute. |
Boolean doProgressTask (taskLength:Number, javaScriptString:String)
Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel.
Parameter |
Type |
Description |
---|---|---|
taskLength |
Amount of the unused progress bar to section off, between 0.0 and 1.0. |
|
javaScriptString |
JavaScriptString to execute. |
undefined eraseCustomOptions (key:String)
Removes the specified user objects from the Photoshop registry.
Parameter |
Type |
Description |
---|---|---|
key |
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 |
The action descriptor to play. |
|
displayDialogs |
The display permissions for dialogs and alert messages. |
ActionDescriptor executeActionGet (reference:ActionReference)
Obtains an action descriptor.
Parameter |
Type |
Description |
---|---|---|
reference |
The reference specification of the property. |
Boolean featureEnabled (name:String)
If true, the specified feature is enabled.
Parameter |
Type |
Description |
---|---|---|
name |
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 |
The unique string ID for the user object. |
Boolean isQuicktimeAvailable ()
Returns true if Quicktime is installed.
undefined load (document:File)
Loads a support document.
Parameter |
Type |
Description |
---|---|---|
document |
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 |
Options for creating the contact sheet. |
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 |
The location of the output file. |
|
options |
Options for the PDF presentation. |
String makePhotoGallery (inputFolder:Varies, outputFolder:File, [options:GalleryOptions])
DEPRECATED. Creates a web photo gallery.
Parameter |
Type |
Description |
---|---|---|
inputFolder |
Varies |
Folder to process or an array of files to process. |
outputFolder |
Location for output files. |
|
options |
Options for the web photo gallery. |
String makePhotomerge (inputFiles:AliasArray)
DEPRECATED. 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 |
Options for creating a Picture Package. |
Document open (document:File, [as:Varies], [asSmartObject:Boolean=Boolean])
Opens the specified document file(s).
Parameter |
Type |
Description |
---|---|---|
document |
The document(s) to opend. |
|
as |
Varies |
The document type (The default is to let Photoshop deduce the format). |
asSmartObject |
Creates a smart object around the document. (default: false) |
FileArray openDialog ()
Uses the Photoshop open dialog to select files.
undefined purge (target:PurgeTarget)
Purges one or more caches.
Parameter |
Type |
Description |
---|---|---|
target |
The caches to purge. |
undefined putCustomOptions (key:String, customObject:ActionDescriptor, [persistent:Boolean=Boolean])
Save user objects in the Photoshop registry.
Parameter |
Type |
Description |
---|---|---|
key |
The unique string ID for the user object. |
|
customObject |
The user-defined custom object to save in the registry. |
|
persistent |
If true, the object persists after the script has finished. (default: true) |
undefined refresh ()
Pauses the script until the application refreshes.
undefined refreshFonts ()
Force the font list to get refreshed.
undefined runMenuItem (menuID:Int)
Run a menu item.
Parameter |
Type |
Description |
---|---|---|
menuID |
Int |
Id of menu to run. |
undefined saveToolBrushToFile (file:File)
PRIVATE - save the current tool brush to a file.
Parameter |
Type |
Description |
---|---|---|
file |
File to save the brush to. |
Boolean showColorPicker ([pickForeground:Boolean=Boolean])
Display color picker dialog. Returns false if dialog is cancelled, true otherwise.
Parameter |
Type |
Description |
---|---|---|
pickForeground |
If true the foreground color is chosen, if false the background color is chosen. (default: true) |
Int stringIDToTypeID (stringID:String)
Converts from a string ID to a runtime ID.
Parameter |
Type |
Description |
---|---|---|
stringID |
The ID to convert. |
Int system (callString:String)
Perform a system call.
Parameter |
Type |
Description |
---|---|---|
callString |
System call string. |
undefined thumbnailStyleFile (file:File, dest:File, [thumbnailSize:Int], [backgroundValue:Number])
PRIVATE - write out a thumbnail file from a style file.
Parameter |
Type |
Description |
---|---|---|
file |
Style file to read. |
|
dest |
Thumb file to write. |
|
thumbnailSize |
Int |
Size of thumbnail to save. |
backgroundValue |
Background grayvalue. |
undefined thumbnailText (dest:File, [text:String], [font:String], [size:Int], [color:SolidColor])
PRIVATE - write out a thumbnail file from text parameters.
Parameter |
Type |
Description |
---|---|---|
dest |
Thumb file to write. |
|
text |
Text to render. |
|
font |
PostScript name of font. |
|
size |
Int |
Size of type. |
color |
Color of type. |
undefined togglePalettes ()
Toggle palette visibility.
Boolean toolSupportsBrushes (tool:String)
Check if the specified tool supports brushes.
Parameter |
Type |
Description |
---|---|---|
tool |
The name of the tool to check. |
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. |
Boolean updateProgress (done:Int, total:Int)
Updates the progress bar started by doProgress. Use for manual non-task based progress updating. Returns false on cancel.
Parameter |
Type |
Description |
---|---|---|
done |
Int |
The number of tasks completed. |
total |
Int |
The total number of tasks. |