Application
Application
Section titled “Application”app
Description
Section titled “Description”The Adobe® Illustrator® application object, referenced using the pre-defined global app object, which contains all other Illustrator objects.
Properties
Section titled “Properties”Application.activeDocument
Section titled “Application.activeDocument”app.activeDocument
Description
Section titled “Description”The active (frontmost) document in Illustrator.
Application.browserAvailable
Section titled “Application.browserAvailable”app.browserAvailable
Description
Section titled “Description”If true
, a web browser is available.
Boolean; read-only.
Application.buildNumber
Section titled “Application.buildNumber”app.buildNumber
Description
Section titled “Description”The application’s build number.
String; read-only.
Application.colorSettingsList
Section titled “Application.colorSettingsList”app.colorSettingsList
Description
Section titled “Description”The list of color-settings files currently available for use.
Object; read-only.
Application.coordinateSystem
Section titled “Application.coordinateSystem”app.coordinateSystem
Description
Section titled “Description”The coordinate system currently in use, document or artboard.
Application.defaultColorSettings
Section titled “Application.defaultColorSettings”app.defaultColorSettings
Description
Section titled “Description”The default color-settings file for the current application locale.
File object; read-only.
Application.documents
Section titled “Application.documents”app.documents
Description
Section titled “Description”The documents in the application.
Application.flattenerPresetList
Section titled “Application.flattenerPresetList”app.flattenerPresetList
Description
Section titled “Description”The list of flattener style names currently available for use.
Object; read-only.
Application.freeMemory
Section titled “Application.freeMemory”app.freeMemory
Description
Section titled “Description”The amount of unused memory (in bytes) within the Illustrator partition.
Number (long); read-only.
Application.locale
Section titled “Application.locale”app.locale
Description
Section titled “Description”The application’s locale.
String; read-only.
Application.name
Section titled “Application.name”app.name
Description
Section titled “Description”The application’s name (not related to the filename of the application file).
String; read-only.
Application.pasteRememberLayers
Section titled “Application.pasteRememberLayers”app.pasteRememberLayers
Description
Section titled “Description”If true
, the paste operation maintains the layer structure.
Boolean; read-only.
Application.path
Section titled “Application.path”app.path
Description
Section titled “Description”The file path to the application.
File object; read-only.
Application.PDFPresetsList
Section titled “Application.PDFPresetsList”app.PDFPresetsList
Description
Section titled “Description”The list of preset PDF-options names available for use.
Object; read-only.
Application.PPDFileList
Section titled “Application.PPDFileList”app.PPDFileList
Description
Section titled “Description”The list of PPD files currently available for use.
Object; read-only.
Application.preferences
Section titled “Application.preferences”app.preferences
Description
Section titled “Description”Illustrator’s preference settings.
Application.printerList
Section titled “Application.printerList”app.printerList
Description
Section titled “Description”The list of installed printers.
Array of Printer
Application.printPresetsList
Section titled “Application.printPresetsList”app.printPresetsList
Description
Section titled “Description”The list of preset printing-options names available for use.
Object; read-only.
Application.scriptingVersion
Section titled “Application.scriptingVersion”app.scriptingVersion
Description
Section titled “Description”The version of the Scripting plug-in.
String; read-only.
Application.selection
Section titled “Application.selection”app.selection
Description
Section titled “Description”All currently selected objects in the active (frontmost) document.
Array of Objects; read-only.
Application.startupPresetsList
Section titled “Application.startupPresetsList”app.startupPresetsList
Description
Section titled “Description”The list of presets available for creating a new document.
Object; read-only.
Application.textFonts
Section titled “Application.textFonts”app.textFonts
Description
Section titled “Description”The installed fonts.
Application.tracingPresetList
Section titled “Application.tracingPresetList”app.tracingPresetList
Description
Section titled “Description”The list of preset tracing-options names available for use.
Array of Strings; read-only.
Application.typename
Section titled “Application.typename”app.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Application.userInteractionLevel
Section titled “Application.userInteractionLevel”app.userInteractionLevel
Description
Section titled “Description”What level of interaction with the user should be allowed when handling script commands.
Application.version
Section titled “Application.version”app.version
Description
Section titled “Description”The application’s version.
String; read-only.
Application.visible
Section titled “Application.visible”app.visible
Description
Section titled “Description”If true
, the application is visible.
Boolean; read-only.
Methods
Section titled “Methods”Application.beep()
Section titled “Application.beep()”app.beep()
Description
Section titled “Description”Alerts the user.
Returns
Section titled “Returns”Nothing.
Application.concatenateMatrix()
Section titled “Application.concatenateMatrix()”app.concatenateMatrix(matrix, secondMatrix)
Description
Section titled “Description”Joins two matrices together.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
matrix | Matrix | First matrix |
secondMatrix | Matrix | Second matrix |
Returns
Section titled “Returns”jsobjref/Matrix.
Application.concatenateRotationMatrix()
Section titled “Application.concatenateRotationMatrix()”app.concatenateRotationMatrix(matrix, angle)
Description
Section titled “Description”Joins a rotation translation to a transformation matrix.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
matrix | Matrix | Matrix |
angle | Number (double) | Angle |
Returns
Section titled “Returns”jsobjref/Matrix.
Application.concatenateScaleMatrix()
Section titled “Application.concatenateScaleMatrix()”app.concatenateScaleMatrix(matrix[, scaleX][, scaleY])
Description
Section titled “Description”Concatenates a scale translation to a transformation matrix.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
matrix | Matrix | Matrix |
scaleX | Number (double), optional | X Scale |
scaleY | Number (dobule), optional | Y Scale |
Returns
Section titled “Returns”Application.concatenateTranslationMatrix()
Section titled “Application.concatenateTranslationMatrix()”app.concatenateTranslationMatrix(matrix[, deltaX][, deltaY])
Description
Section titled “Description”Joins a translation to a transformation matrix.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
matrix | Matrix | Matrix |
deltaX | Number (double), optional | X Delta |
deltaY | Number (dobule), optional | Y Delta |
Returns
Section titled “Returns”Application.convertSampleColor()
Section titled “Application.convertSampleColor()”app.convertSampleColor( sourceColorSpace, sourceColor, destColorSpace, colorConvertPurpose [, sourceHasAlpha] [, destHasAlpha])
Description
Section titled “Description”Converts a sample-component color from one color space to another.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
sourceColorSpace | ImageColorSpace | Color space of source color |
sourceColor | ColorComponents | Source color to convert |
destColorSpace | ImageColorSpace | Destination color space |
colorConvertPurpose | ColorConvertPurpose | The purpose of the convert |
sourceHasAlpha | Boolean, optional | Whether the source has alpha |
destHasAlpha | Boolean, optional | Whether the destination has alpha |
Returns
Section titled “Returns”Array of ColorComponents
Application.copy()
Section titled “Application.copy()”app.copy()
Description
Section titled “Description”Copies current selection to the clipboard.
Returns
Section titled “Returns”Nothing.
Application.cut()
Section titled “Application.cut()”app.cut()
Description
Section titled “Description”Cuts current selection to the clipboard.
Returns
Section titled “Returns”Nothing.
Application.deleteWorkspace()
Section titled “Application.deleteWorkspace()”app.deleteWorkspace(workspaceName)
Description
Section titled “Description”Deletes an existing workspace.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
workspaceName | String | Name of workspace to delete |
Returns
Section titled “Returns”Boolean
Application.getIdentityMatrix()
Section titled “Application.getIdentityMatrix()”app.getIdentityMatrix()
Description
Section titled “Description”Returns an identity matrix.
Returns
Section titled “Returns”Application.getIsFileOpen()
Section titled “Application.getIsFileOpen()”app.getIsFileOpen(filePath)
Description
Section titled “Description”Returns whether the specified filePath is open
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
filePath | String | File path to check |
Returns
Section titled “Returns”Boolean
Application.getPPDFileInfo()
Section titled “Application.getPPDFileInfo()”app.getPPDFileInfo(name)
Description
Section titled “Description”Gets detailed file information for specified PPD file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
name | String | File name to get info for |
Returns
Section titled “Returns”Application.getPresetFileOfType()
Section titled “Application.getPresetFileOfType()”app.getPresetFileOfType(presetType)
Description
Section titled “Description”Returns the full path to the application’s default document profile for the specified preset type.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
presetType | DocumentPresetType | Preset type to get file of |
Returns
Section titled “Returns”File object
Application.getPresetSettings()
Section titled “Application.getPresetSettings()”app.getPresetSettings(preset)
Description
Section titled “Description”Retrieves the tracing-option settings from the template with a given preset name.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
preset | String | Preset name to get settings from |
Returns
Section titled “Returns”Application.getRotationMatrix()
Section titled “Application.getRotationMatrix()”app.getRotationMatrix([angle])
Description
Section titled “Description”Returns a transformation matrix containing a single rotation.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
angle | Number (double), optional | Angle to get matrix of |
Returns
Section titled “Returns”Example
Section titled “Example”Rotate the object 30 degrees counterclockwise:
app.getRotationMatrix(30);
Rotate 30 degrees clockwise:
app.getRotationMatrix(-30);
Application.getScaleMatrix()
Section titled “Application.getScaleMatrix()”app.getScaleMatrix([scaleX][, scaleY])
Description
Section titled “Description”Returns a transformation matrix containing a single scale.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
scaleX | Number (double), optional | X scale to get matrix of |
scaleY | Number (double), optional | Y scale to get matrix of |
Returns
Section titled “Returns”Example
Section titled “Example”Scale the object to 60% of its original size:
app.getScaleMatrix(60, 60);
Double the object’s bounds:
app.getScaleMatrix(200, 200);
Application.getScriptableHelpGroup()
Section titled “Application.getScriptableHelpGroup()”app.getScriptableHelpGroup()
Description
Section titled “Description”Gets the scriptable help group object that represents the search widget in the app bar.
Returns
Section titled “Returns”Variant
Application.getTranslationMatrix()
Section titled “Application.getTranslationMatrix()”app.getTranslationMatrix([deltaX][, deltaY])
Description
Section titled “Description”Returns a transformation matrix containing a single translation.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
deltaX | Number (double), optional | X Delta |
deltaY | Number (dobule), optional | Y Delta |
Returns
Section titled “Returns”Example
Section titled “Example”Move the object 100 pt. to the right and 200 pt. up:
app.getTranslationMatrix(100, 200);
Move them left and down:
app.getTranslationMatrix(-100, -200);
Application.invertMatrix()
Section titled “Application.invertMatrix()”app.invertMatrix(matrix)
Description
Section titled “Description”Inverts a matrix.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
matrix | Matrix | Matrix to invert |
Returns
Section titled “Returns”Application.isEqualMatrix()
Section titled “Application.isEqualMatrix()”app.isEqualMatrix(matrix, secondMatrix)
Description
Section titled “Description”Checks whether the two matrices are equal.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
matrix | Matrix | First matrix to check |
secondMatrix | Matrix | Second matrix to check |
Returns
Section titled “Returns”Boolean
Application.isSingularMatrix()
Section titled “Application.isSingularMatrix()”app.isSingularMatrix(matrix)
Description
Section titled “Description”Checks whether a matrix is singular and cannot be inverted.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
matrix | Matrix | Matrix to check |
Returns
Section titled “Returns”Boolean
Application.loadColorSettings()
Section titled “Application.loadColorSettings()”app.loadColorSettings(fileSpec)
Description
Section titled “Description”Loads color settings from specified file, or, if file is empty, turns color management off.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
fileSpec | File object | File to load settings from |
Returns
Section titled “Returns”Nothing.
Application.open()
Section titled “Application.open()”app.open(file[, documentColorSpace][, options])
Description
Section titled “Description”Opens the specified document file.
If the parameter is not supplied, Illustrator opens a dialog so the user can choose the color space.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
file | File object | File to open |
documentColorSpace | DocumentColorSpace, optional | Color space of document |
options | anything | todo |
Returns
Section titled “Returns”Application.paste()
Section titled “Application.paste()”app.paste()
Description
Section titled “Description”Pastes current clipboard content into the current document.
Returns
Section titled “Returns”Nothing.
Application.quit()
Section titled “Application.quit()”app.quit()
Description
Section titled “Description”Quits Illustrator.
Returns
Section titled “Returns”Nothing.
Application.redo()
Section titled “Application.redo()”app.redo()
Description
Section titled “Description”Redoes the most recently undone transaction.
Returns
Section titled “Returns”Nothing.
Application.redraw()
Section titled “Application.redraw()”app.redraw()
Description
Section titled “Description”Forces Illustrator to redraw all its windows.
Returns
Section titled “Returns”Nothing.
Application.resetWorkspace()
Section titled “Application.resetWorkspace()”app.resetWorkspace()
Description
Section titled “Description”Resets the current workspace.
Returns
Section titled “Returns”Boolean
Application.saveWorkspace()
Section titled “Application.saveWorkspace()”app.saveWorkspace(workspaceName)
Description
Section titled “Description”Saves a new workspace.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
workspaceName | String | Name of workspace to save as |
Returns
Section titled “Returns”Boolean
Application.sendScriptMessage()
Section titled “Application.sendScriptMessage()”app.sendScriptMessage(pluginName, messageSelector, inputString)
Description
Section titled “Description”Sends a plug-in-defined command message to a plug-in with given input arguments, and returns the plug-in-defined result string.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
pluginName | String | Name of plugin to send message to |
messageSelector | String | Message to send to the plugin |
inputString | String | Data to pass into the command |
Returns
Section titled “Returns”String
Application.showPresets()
Section titled “Application.showPresets()”app.showPresets(fileSpec)
Description
Section titled “Description”Gets presets from the file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
fileSpec | File object | File to get presets from |
Returns
Section titled “Returns”PrintPresetList
Application.switchWorkspace()
Section titled “Application.switchWorkspace()”app.switchWorkspace(workspaceName)
Description
Section titled “Description”Switches to the specified workspace.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
workspaceName | String | Name to switch to |
Returns
Section titled “Returns”Boolean
Application.translatePlaceholderText()
Section titled “Application.translatePlaceholderText()”app.translatePlaceholderText(text)
Description
Section titled “Description”Translates the placeholder text to regular text (a way to enter Unicode points in hex values).
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
text | String | String to translate |
Returns
Section titled “Returns”String
Application.undo()
Section titled “Application.undo()”app.undo()
Description
Section titled “Description”Undoes the most recent transaction.
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Duplicating the Active Document
Section titled “Duplicating the Active Document”// Duplicates any selected items from// the active document into a new document.
var newItem;var docSelected = app.activeDocument.selection;
if (docSelected.length > 0) { // Create a new document and move the selected items to it. var newDoc = app.documents.add(); if (docSelected.length > 0) { for (var i = 0; i < docSelected.length; i++) { docSelected[i].selected = false; newItem = docSelected[i].duplicate(newDoc, ElementPlacement.PLACEATEND); } } else { docSelected.selected = false; newItem = docSelected.parent.duplicate(newDoc, ElementPlacement.PLACEATEND); }} else { alert("Please select one or more art objects");}