Skip to content

Application

Application

app

Description

The Adobe® Illustrator® application object, referenced using the pre-defined global app object, which contains all other Illustrator objects.


Properties

Application.activeDocument

app.activeDocument

Description

The active (frontmost) document in Illustrator.

Type

Document


Application.browserAvailable

app.browserAvailable

Description

If true, a web browser is available.

Type

Boolean; read-only.


Application.buildNumber

app.buildNumber

Description

The application’s build number.

Type

String; read-only.


Application.colorSettingsList

app.colorSettingsList

Description

The list of color-settings files currently available for use.

Type

Object; read-only.


Application.coordinateSystem

app.coordinateSystem

Description

The coordinate system currently in use, document or artboard.

Type

CoordinateSystem


Application.defaultColorSettings

app.defaultColorSettings

Description

The default color-settings file for the current application locale.

Type

File object; read-only.


Application.documents

app.documents

Description

The documents in the application.

Type

Documents


Application.flattenerPresetList

app.flattenerPresetList

Description

The list of flattener style names currently available for use.

Type

Object; read-only.


Application.freeMemory

app.freeMemory

Description

The amount of unused memory (in bytes) within the Illustrator partition.

Type

Number (long); read-only.


Application.locale

app.locale

Description

The application’s locale.

Type

String; read-only.


Application.name

app.name

Description

The application’s name (not related to the filename of the application file).

Type

String; read-only.


Application.pasteRememberLayers

app.pasteRememberLayers

Description

If true, the paste operation maintains the layer structure.

Type

Boolean; read-only.


Application.path

app.path

Description

The file path to the application.

Type

File object; read-only.


Application.PDFPresetsList

app.PDFPresetsList

Description

The list of preset PDF-options names available for use.

Type

Object; read-only.


Application.PPDFileList

app.PPDFileList

Description

The list of PPD files currently available for use.

Type

Object; read-only.


Application.preferences

app.preferences

Description

Illustrator’s preference settings.

Type

Preferences


Application.printerList

app.printerList

Description

The list of installed printers.

Type

Array of Printer


Application.printPresetsList

app.printPresetsList

Description

The list of preset printing-options names available for use.

Type

Object; read-only.


Application.scriptingVersion

app.scriptingVersion

Description

The version of the Scripting plug-in.

Type

String; read-only.


Application.selection

app.selection

Description

All currently selected objects in the active (frontmost) document.

Type

Array of Objects; read-only.


Application.startupPresetsList

app.startupPresetsList

Description

The list of presets available for creating a new document.

Type

Object; read-only.


Application.textFonts

app.textFonts

Description

The installed fonts.

Type

TextFonts


Application.tracingPresetList

app.tracingPresetList

Description

The list of preset tracing-options names available for use.

Type

Array of Strings; read-only.


Application.typename

app.typename

Description

The class name of the referenced object.

Type

String; read-only.


Application.userInteractionLevel

app.userInteractionLevel

Description

What level of interaction with the user should be allowed when handling script commands.

Type

UserInteractionLevel


Application.version

app.version

Description

The application’s version.

Type

String; read-only.


Application.visible

app.visible

Description

If true, the application is visible.

Type

Boolean; read-only.


Methods

Application.beep()

app.beep()

Description

Alerts the user.

Returns

Nothing.


Application.concatenateMatrix()

app.concatenateMatrix(matrix, secondMatrix)

Description

Joins two matrices together.

Parameters

ParameterTypeDescription
matrixMatrixFirst matrix
secondMatrixMatrixSecond matrix

Returns

jsobjref/Matrix.


Application.concatenateRotationMatrix()

app.concatenateRotationMatrix(matrix, angle)

Description

Joins a rotation translation to a transformation matrix.

Parameters

ParameterTypeDescription
matrixMatrixMatrix
angleNumber (double)Angle

Returns

jsobjref/Matrix.


Application.concatenateScaleMatrix()

app.concatenateScaleMatrix(matrix[, scaleX][, scaleY])

Description

Concatenates a scale translation to a transformation matrix.

Parameters

ParameterTypeDescription
matrixMatrixMatrix
scaleXNumber (double), optionalX Scale
scaleYNumber (dobule), optionalY Scale

Returns

Matrix


Application.concatenateTranslationMatrix()

app.concatenateTranslationMatrix(matrix[, deltaX][, deltaY])

Description

Joins a translation to a transformation matrix.

Parameters

ParameterTypeDescription
matrixMatrixMatrix
deltaXNumber (double), optionalX Delta
deltaYNumber (dobule), optionalY Delta

Returns

Matrix


Application.convertSampleColor()

app.convertSampleColor(
sourceColorSpace,
sourceColor,
destColorSpace,
colorConvertPurpose
[, sourceHasAlpha]
[, destHasAlpha]
)

Description

Converts a sample-component color from one color space to another.

Parameters

ParameterTypeDescription
sourceColorSpaceImageColorSpaceColor space of source color
sourceColorColorComponentsSource color to convert
destColorSpaceImageColorSpaceDestination color space
colorConvertPurposeColorConvertPurposeThe purpose of the convert
sourceHasAlphaBoolean, optionalWhether the source has alpha
destHasAlphaBoolean, optionalWhether the destination has alpha

Returns

Array of ColorComponents


Application.copy()

app.copy()

Description

Copies current selection to the clipboard.

Returns

Nothing.


Application.cut()

app.cut()

Description

Cuts current selection to the clipboard.

Returns

Nothing.


Application.deleteWorkspace()

app.deleteWorkspace(workspaceName)

Description

Deletes an existing workspace.

Parameters

ParameterTypeDescription
workspaceNameStringName of workspace to delete

Returns

Boolean


Application.getIdentityMatrix()

app.getIdentityMatrix()

Description

Returns an identity matrix.

Returns

Matrix


Application.getIsFileOpen()

app.getIsFileOpen(filePath)

Description

Returns whether the specified filePath is open

Parameters

ParameterTypeDescription
filePathStringFile path to check

Returns

Boolean


Application.getPPDFileInfo()

app.getPPDFileInfo(name)

Description

Gets detailed file information for specified PPD file.

Parameters

ParameterTypeDescription
nameStringFile name to get info for

Returns

PPDFileInfo


Application.getPresetFileOfType()

app.getPresetFileOfType(presetType)

Description

Returns the full path to the application’s default document profile for the specified preset type.

Parameters

ParameterTypeDescription
presetTypeDocumentPresetTypePreset type to get file of

Returns

File object


Application.getPresetSettings()

app.getPresetSettings(preset)

Description

Retrieves the tracing-option settings from the template with a given preset name.

Parameters

ParameterTypeDescription
presetStringPreset name to get settings from

Returns

DocumentPreset


Application.getRotationMatrix()

app.getRotationMatrix([angle])

Description

Returns a transformation matrix containing a single rotation.

Parameters

ParameterTypeDescription
angleNumber (double), optionalAngle to get matrix of

Returns

Matrix

Example

Rotate the object 30 degrees counterclockwise:

app.getRotationMatrix(30);

Rotate 30 degrees clockwise:

app.getRotationMatrix(-30);

Application.getScaleMatrix()

app.getScaleMatrix([scaleX][, scaleY])

Description

Returns a transformation matrix containing a single scale.

Parameters

ParameterTypeDescription
scaleXNumber (double), optionalX scale to get matrix of
scaleYNumber (double), optionalY scale to get matrix of

Returns

Matrix

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()

app.getScriptableHelpGroup()

Description

Gets the scriptable help group object that represents the search widget in the app bar.

Returns

Variant


Application.getTranslationMatrix()

app.getTranslationMatrix([deltaX][, deltaY])

Description

Returns a transformation matrix containing a single translation.

Parameters

ParameterTypeDescription
deltaXNumber (double), optionalX Delta
deltaYNumber (dobule), optionalY Delta

Returns

Matrix

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()

app.invertMatrix(matrix)

Description

Inverts a matrix.

Parameters

ParameterTypeDescription
matrixMatrixMatrix to invert

Returns

Matrix


Application.isEqualMatrix()

app.isEqualMatrix(matrix, secondMatrix)

Description

Checks whether the two matrices are equal.

Parameters

ParameterTypeDescription
matrixMatrixFirst matrix to check
secondMatrixMatrixSecond matrix to check

Returns

Boolean


Application.isSingularMatrix()

app.isSingularMatrix(matrix)

Description

Checks whether a matrix is singular and cannot be inverted.

Parameters

ParameterTypeDescription
matrixMatrixMatrix to check

Returns

Boolean


Application.loadColorSettings()

app.loadColorSettings(fileSpec)

Description

Loads color settings from specified file, or, if file is empty, turns color management off.

Parameters

ParameterTypeDescription
fileSpecFile objectFile to load settings from

Returns

Nothing.


Application.open()

app.open(file[, documentColorSpace][, options])

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

ParameterTypeDescription
fileFile objectFile to open
documentColorSpaceDocumentColorSpace, optionalColor space of document
optionsanythingtodo

Returns

Document


Application.paste()

app.paste()

Description

Pastes current clipboard content into the current document.

Returns

Nothing.


Application.quit()

app.quit()

Description

Quits Illustrator.

Returns

Nothing.


Application.redo()

app.redo()

Description

Redoes the most recently undone transaction.

Returns

Nothing.


Application.redraw()

app.redraw()

Description

Forces Illustrator to redraw all its windows.

Returns

Nothing.


Application.resetWorkspace()

app.resetWorkspace()

Description

Resets the current workspace.

Returns

Boolean


Application.saveWorkspace()

app.saveWorkspace(workspaceName)

Description

Saves a new workspace.

Parameters

ParameterTypeDescription
workspaceNameStringName of workspace to save as

Returns

Boolean


Application.sendScriptMessage()

app.sendScriptMessage(pluginName, messageSelector, inputString)

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

ParameterTypeDescription
pluginNameStringName of plugin to send message to
messageSelectorStringMessage to send to the plugin
inputStringStringData to pass into the command

Returns

String


Application.showPresets()

app.showPresets(fileSpec)

Description

Gets presets from the file.

Parameters

ParameterTypeDescription
fileSpecFile objectFile to get presets from

Returns

PrintPresetList


Application.switchWorkspace()

app.switchWorkspace(workspaceName)

Description

Switches to the specified workspace.

Parameters

ParameterTypeDescription
workspaceNameStringName to switch to

Returns

Boolean


Application.translatePlaceholderText()

app.translatePlaceholderText(text)

Description

Translates the placeholder text to regular text (a way to enter Unicode points in hex values).

Parameters

ParameterTypeDescription
textStringString to translate

Returns

String


Application.undo()

app.undo()

Description

Undoes the most recent transaction.

Returns

Nothing.


Example

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");
}