Skip to content

Application

app

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


app.activeDocument

The active (frontmost) document in Illustrator.

Document


app.browserAvailable

If true, a web browser is available.

Boolean; read-only.


app.buildNumber

The application’s build number.

String; read-only.


app.colorSettingsList

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

Object; read-only.


app.coordinateSystem

The coordinate system currently in use, document or artboard.

CoordinateSystem


app.defaultColorSettings

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

File object; read-only.


app.documents

The documents in the application.

Documents


app.flattenerPresetList

The list of flattener style names currently available for use.

Object; read-only.


app.freeMemory

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

Number (long); read-only.


app.locale

The application’s locale.

String; read-only.


app.name

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

String; read-only.


app.pasteRememberLayers

If true, the paste operation maintains the layer structure.

Boolean; read-only.


app.path

The file path to the application.

File object; read-only.


app.PDFPresetsList

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

Object; read-only.


app.PPDFileList

The list of PPD files currently available for use.

Object; read-only.


app.preferences

Illustrator’s preference settings.

Preferences


app.printerList

The list of installed printers.

Array of Printer


app.printPresetsList

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

Object; read-only.


app.scriptingVersion

The version of the Scripting plug-in.

String; read-only.


app.selection

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

Array of Objects; read-only.


app.startupPresetsList

The list of presets available for creating a new document.

Object; read-only.


app.textFonts

The installed fonts.

TextFonts


app.tracingPresetList

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

Array of Strings; read-only.


app.typename

The class name of the referenced object.

String; read-only.


app.userInteractionLevel

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

UserInteractionLevel


app.version

The application’s version.

String; read-only.


app.visible

If true, the application is visible.

Boolean; read-only.


app.beep()

Alerts the user.

Nothing.


app.concatenateMatrix(matrix, secondMatrix)

Joins two matrices together.

ParameterTypeDescription
matrixMatrixFirst matrix
secondMatrixMatrixSecond matrix

jsobjref/Matrix.


app.concatenateRotationMatrix(matrix, angle)

Joins a rotation translation to a transformation matrix.

ParameterTypeDescription
matrixMatrixMatrix
angleNumber (double)Angle

jsobjref/Matrix.


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

Concatenates a scale translation to a transformation matrix.

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

Matrix


Application.concatenateTranslationMatrix()

Section titled “Application.concatenateTranslationMatrix()”

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

Joins a translation to a transformation matrix.

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

Matrix


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

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

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

Array of ColorComponents


app.copy()

Copies current selection to the clipboard.

Nothing.


app.cut()

Cuts current selection to the clipboard.

Nothing.


app.deleteWorkspace(workspaceName)

Deletes an existing workspace.

ParameterTypeDescription
workspaceNameStringName of workspace to delete

Boolean


app.getIdentityMatrix()

Returns an identity matrix.

Matrix


app.getIsFileOpen(filePath)

Returns whether the specified filePath is open

ParameterTypeDescription
filePathStringFile path to check

Boolean


app.getPPDFileInfo(name)

Gets detailed file information for specified PPD file.

ParameterTypeDescription
nameStringFile name to get info for

PPDFileInfo


app.getPresetFileOfType(presetType)

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

ParameterTypeDescription
presetTypeDocumentPresetTypePreset type to get file of

File object


app.getPresetSettings(preset)

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

ParameterTypeDescription
presetStringPreset name to get settings from

DocumentPreset


app.getRotationMatrix([angle])

Returns a transformation matrix containing a single rotation.

ParameterTypeDescription
angleNumber (double), optionalAngle to get matrix of

Matrix

Rotate the object 30 degrees counterclockwise:

app.getRotationMatrix(30);

Rotate 30 degrees clockwise:

app.getRotationMatrix(-30);

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

Returns a transformation matrix containing a single scale.

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

Matrix

Scale the object to 60% of its original size:

app.getScaleMatrix(60, 60);

Double the object’s bounds:

app.getScaleMatrix(200, 200);

app.getScriptableHelpGroup()

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

Variant


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

Returns a transformation matrix containing a single translation.

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

Matrix

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

app.invertMatrix(matrix)

Inverts a matrix.

ParameterTypeDescription
matrixMatrixMatrix to invert

Matrix


app.isEqualMatrix(matrix, secondMatrix)

Checks whether the two matrices are equal.

ParameterTypeDescription
matrixMatrixFirst matrix to check
secondMatrixMatrixSecond matrix to check

Boolean


app.isSingularMatrix(matrix)

Checks whether a matrix is singular and cannot be inverted.

ParameterTypeDescription
matrixMatrixMatrix to check

Boolean


app.loadColorSettings(fileSpec)

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

ParameterTypeDescription
fileSpecFile objectFile to load settings from

Nothing.


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

Opens the specified document file.

If the parameter is not supplied, Illustrator opens a dialog so the user can choose the color space.

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

Document


app.paste()

Pastes current clipboard content into the current document.

Nothing.


app.quit()

Quits Illustrator.

Nothing.


app.redo()

Redoes the most recently undone transaction.

Nothing.


app.redraw()

Forces Illustrator to redraw all its windows.

Nothing.


app.resetWorkspace()

Resets the current workspace.

Boolean


app.saveWorkspace(workspaceName)

Saves a new workspace.

ParameterTypeDescription
workspaceNameStringName of workspace to save as

Boolean


app.sendScriptMessage(pluginName, messageSelector, inputString)

Sends a plug-in-defined command message to a plug-in with given input arguments, and returns the plug-in-defined result string.

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

String


app.showPresets(fileSpec)

Gets presets from the file.

ParameterTypeDescription
fileSpecFile objectFile to get presets from

PrintPresetList


app.switchWorkspace(workspaceName)

Switches to the specified workspace.

ParameterTypeDescription
workspaceNameStringName to switch to

Boolean


app.translatePlaceholderText(text)

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

ParameterTypeDescription
textStringString to translate

String


app.undo()

Undoes the most recent transaction.

Nothing.


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