Top-Level (containing) Objects
Top-Level (containing) Objects
Section titled “Top-Level (containing) Objects”Use these objects to access global information about the Illustrator application or an individual document.
Application
Section titled “Application”The properties of the application object give your script access to global values, such as:
- User
preferences, which a user sets interactively in the Illustrator application by using the Preferences dialog (Edit > Preferences). - System information like installed fonts (the
text fontsproperty) and printers (theprinter listproperty).
Also, there are properties that provide application-specific information and higher-level information about any open documents:
- Application information like the installation
path,version, and whether Illustrator isvisible. - The
current activedocument; that is, the art canvas that is displayed and accepting user input. - All open
documents.
The application object’s methods or commands allow your script to perform application-wide actions; for example:
OpenfilesUndoandredotransactionsQuitIllustrator
Document
Section titled “Document”The document object, which your scripts can create or access through the application object, represents an art canvas or loaded Illustrator file.
The document object’s properties give you access to the document’s content; for example:
- The current
selection, or art objects that the user selected in the document - All contained art objects, called
page items, that make up the artwork tree - Art objects of particular types, like
symbolsandtext frames - All
layersand the currentlyactive layer
Document properties also tell you about the state of the document itself; for example:
- User settings for the document, such as
ruler units - Whether the document was
savedsince the last alteration of content - The
pathof the associated file
The document object’s methods allow your scripts to act on the document; for example:
Saveto an Illustrator file orsave asthe various supported file formatsActivateorclosea documentPrintthe document. Your scripts can select a printer by referencing aprint optionsobject, or they can reference available printers through the application object’sprinter listproperty.
The layer object provides access to the contents, or artwork tree, of a specific layer.
You access the layer object through the document object.
The layer object properties provide access to, or information about, the layer, such as:
- Whether the layer is
visibleorlocked. - The layer’s
opacity(overall transparency) andz order position(position in the stacking order). - Art-creation preferences for the layer, like
artwork knockoutandblending mode.