What’s new in Illustrator 31
The scripting API of Illustrator 31 compared with Illustrator 29. 7 new objects, 59 changes on 14 objects, 1 that can break existing scripts. Generated from Adobe’s object model exports.
Highlights
WebP and AVIF export
Export and Export for Screens know WebP and AVIF, each with its own options object, and exportAsFormat() writes any format listed in ExportFileType. In 31.0 only WebP works from a script; every AVIF export fails with an internal error.
ExportOptionsWebP · ExportOptionsAVIF · ExportForScreensOptionsWebP · ExportForScreensOptionsAVIF · ExportType.WEBP · ExportType.AVIF · ExportForScreensType.SE_WEBP · ExportForScreensType.SE_AVIF · Document.exportAsFormat() · ExportFileType
List styles
Documents carry list styles, and a paragraph can take one together with its tier (level). The predefined styles report internal names such as kPredefinedBulletListStyleTag.
ListStyle · ListStyles · Document.listStyles · ParagraphAttributes.listStyle · ParagraphAttributes.listStyleTier
View rotation renamed
View.rotate is now View.rotateAngle. An old script that sets rotate keeps running without an error but no longer rotates the view.
9-slice scaling for symbols
A symbol can be created with 9-slice scaling guides, and its center slice can be read and set by symbol index.
Symbols.addWith9SliceScaling() · Document.getSymbol9SliceGrid() · Document.setSymbol9SliceGrid() · Document.isSymbolGuidesEnabled() · Document.openSymbolInIsolationMode()
Reading the workspace state
Many new methods report what the user sees — grid, guides, rulers, screen, view and preview mode, isolation and smart edit mode — and a few change it.
Document.isGridVisible() · Document.isRulerVisible() · Document.getScreenMode() · Document.getViewMode() · Document.getPreviewMode() · View.setScreenMode() · Document.isolateSelectedArt() · Document.exitIsolationMode()
Breaking 1
- −property View.rotate removedThe rotation angle of this view.
New objects 7
- +Enumeration ExportFileType 16 membersExport file formats.
- +Object ExportForScreensOptionsAVIF 10 membersOptions which may be provided when exporting a document as a AVIF file.
- +Object ExportForScreensOptionsWebP 10 membersOptions which may be provided when exporting a document as a WebP file.
- +Object ExportOptionsAVIF 8 membersOptions which may be supplied when exporting a document as a AVIF file.
- +Object ExportOptionsWebP 8 membersOptions which may be supplied when exporting a document as a WebP file.
- +Object ListStyle · ListStyles 13 membersA List Style present in the document.
By object 14
Application
- +method dragParticleSystemTool()(toolName, symbolIndex, pathPointList, modifierKey?)Drag a particle system tool using its tool name, a symbol and a list of points.
- +method getSelectedToolName()() → StringReturn which tool is selected.
- +method handleGoToHome()() → BooleanGo to Home Screen.
- +method isPixelPerfect()() → BooleanCheck whether given art is pixel perfect or not.
Artboard
- +method canChangeRulerCoordinateSystem()() → BooleanCheck whether the Ruler Coordinate System can be changed or not.
- +method isVideoRulerVisible()() → BooleanCheck whether the video ruler is visible or not.
Artboards
- +method getNumSelectedArtboard()() → Int32Retrieves the number of selected artboards in the document.
Document
- +property listStyles ListStyles
<ListStyle> readonlyInstalled styles. - +method exitIsolationMode()() → BooleanExit Isolation Mode.
- +method exitSymbolIsolationMode()() → BooleanExit the Symbol Isolation Mode.
- +method exportAsFormat()(exportFormatType, exportInFile)Export the document to specific format.
- +method generateMockup()(imgFile, configFile)Given image and mockup configuration file create mockup art on canvas.
- +method getAllBrushes()() → StringReturns brushes in the Brush Panel.
- +method getDeHighlightedObjectsCount()() → Int32Get DeHighlighted Objects count in SmartEditing Mode.
- +method getDocumentInfoAsText()(menutype, outputFile, selected?) → BooleanRetrieves the document info as text.
- +method getHighlightedObjectsCount()() → Int32Get Highlighted Objects count in SmartEditing Mode.
- +method getPreviewMode()() → StringReturns preview mode.
- +method getScreenMode()() → StringReturn which screen mode is visible.
- +method getSelSymbolSetProps()() → Number[]Get properties of the currently selected symbol set items.
- +method getSelectedBrushes()() → StringReturns brushes selected in the Brush Panel.
- +method getSymbol9SliceGrid()(index) → RectGet the rectangular area of the center slice of the 9 slice grid of the symbol.
- +method getViewMode()() → StringReturns the current view Mode.
- +method isGridVisible()() → BooleanCheck whether Grid is visible or not.
- +method isGuideVisible()() → BooleanCheck whether Guide is visible or not.
- +method isOutlineMode()() → BooleanIs the outline mode enabled?
- +method isPixelGridVisible()() → BooleanCheck whether Pixel Grid is visible or not.
- +method isRulerVisible()() → BooleanCheck whether the ruler is visible or not.
- +method isSmartEditMode()() → BooleanReturn true if SmartEdit Mode is enabled else return false.
- +method isSnapToGridEnabled()() → BooleanCheck whether the Snap To Grid is enabled or not.
- +method isSymbolGuidesEnabled()(index?) → BooleanCheck if guides for 9-slice scaling are enabled for the symbol.
- +method isSymbolIsolationModeActive()() → BooleanReturns true if Symbol Isolation Mode is Active else returns false.
- +method isTransparencyGridVisible()() → BooleanCheck whether transparency grid is visible or not.
- +method isTrimViewEnabled()() → BooleanCheck whether the trim view is enabled or not.
- +method isViewClippedToArtboards()() → BooleanCheck whether view is clipped to Artboards.
- +method isolateSelectedArt()() → BooleanIsolate the selected art.
- +method numSelectedSymbol()() → Int32Number of selected symbols in the Symbol Panel.
- +method openSymbolInIsolationMode()(index?)Open the symbol at the index in isolation mode.
- +method requestPlaceCloudPSD()(pSDCloudPath, placeAsLink)Place cloud psd document.
- +method selectGraphicStyle()(index?)Select the graphic style in the Symbol Panel for which index is provided.
- +method selectSymbol()(index?)Select the symbol in the Symbol Panel for which index is provided.
- +method setSymbol9SliceGrid()(index, left, top, right, bottom)Set the rectangular area of the center slice of the 9 slice grid of the symbol.
ExportForScreensType
ExportType
GroupItem
- +method isDimensionArt()() → BooleanIs this Dimension Art Group?
IllustratorSaveOptions
- +property embedUsedGlyphs BooleanSave AI compatible used font glyphs (version 24 or later)
PageItem
- +method canParallelExecutionRun()(liveEffectXML) → BooleanApply effect in parallel to supported artItem.
ParagraphAttributes
- +property listStyle ListStyleParagraph list style.
- +property listStyleTier Int32Tier/level of the paragraph list style.
PathItem
- +method convertAnchorToCorner()(anchorPointIndex) → BooleanConverts anchor point to corner.
- +method convertAnchorToSmooth()(anchorPointIndex) → BooleanConverts anchor point to smooth.
- +method isAnchorPointCorner()(anchorPointIndex) → BooleanChecks if an anchor point is at corner.
- +method setSmootheningPercentageValue()(smootheningPercentage?)Smoothen the path as per the input percentage value and auto smoothen in case of no input.
Symbols
- +method addWith9SliceScaling()(sourceArt, registrationPoint?) → SymbolCreate a symbol with guides for 9-slice scaling enabled.
TracingOptions
- +property autoGrouping BooleanEnables/Disables Auto Grouping.
View
- +property rotateAngle NumberThe rotation angle of this view.
- +method setScreenMode()(screenMode) → BooleanSet the mode of screen.
Minor 4
Renamed parameters and reworded descriptions. Calls are positional, so a renamed parameter keeps working.
- ~value RulerUnits.Feet description: “Ruler units are measured in pixels.” → “Ruler units are measured in feet.”
- ~value RulerUnits.FeetInches description: “Ruler units are measured in pixels.” → “Ruler units are measured in Feet and Inches.”
- ~value RulerUnits.Meters description: “Ruler units are measured in pixels.” → “Ruler units are measured in meters.”
- ~value RulerUnits.Yards description: “Ruler units are measured in pixels.” → “Ruler units are measured in yards.”