- controlBounds of an object with nothing in it reads zeros, like its
geometric and visible bounds.
- path.rotate and path.resize of a path with no anchors change nothing.
- The path tests make the first rectangle last, so pathItems[0] is the
topmost path as pageItems lists it.
- Point changes that add, remove or replace points deselect the path's
direct-selected anchors even when the counts come out the same;
path.setAnchors takes `reshaped` for this and refuses a non-boolean.
- Moving points or handles, changing a point's type or setting `closed`
keeps the index of where each subpath's points start.
- A failed write keeps the waiting point changes.
- Restoring the selection keeps a segment-only path to its segments.
- getIsFileOpen folds `\` and letter case only on Windows.
- Assigning `undefined` to Document.selection throws with nothing changed.
- A document's path list is charged for the objects it looks at.
- A made path keeps an id above 2^53.
- A host object's handle is charged to the heap limit.
- docs/mcp.md states that node.move into a compound path also needs its
layer and groups shown and unlocked and no locked artboard.
- controlBounds takes in the paths' direction handles. A clipping
group's are its clipping path's.
- A compound path's pathItems is a PathItems collection: add() and the
shape methods make the path inside it.
- resize() scales and sets the stroke weight as one step, so a failed
stroke change undoes the scale too.
- A point change that adds or removes anchors deselects the path's
direct-selected anchors, from a script and from path.setAnchors, so
other anchors are not left selected in their place.
- A script that ends past the allowance of the last answer is asked
again before its changes are kept.
- documents.addDocument starts from the built-in preset when a saved
preset has its name, and Recent keeps the built-in preset's name.
- Saved preset rows past the artboard limit read as the limit.
- Host classes that do not fit the heap end with the heap limit.
- Layers keep their list while the document is unchanged, and getByName
charges its scan on a kept list too.
- Selection ids are deduplicated with a set.
- A path made on the current layer is made in one step, so a failed
stroke or reversal after it undoes the path too.
- Path points are found through a kept index of where each subpath's
points start, rebuilt when the path's points change, so reading every
point of a path with many subpaths is no longer quadratic.
- A pixel-aligned compound path snaps a path moved into it.
Layer.pathItems and GroupItem.pathItems now return a PathItems collection
for the paths directly in the layer or group, topmost first, as the Layer
and GroupItem pages describe them
(https://ai-scripting.docsforadobe.dev/jsobjref/Layer/,
https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/). Before, both
threw an error that said they were not available yet.
- The collection has the members of Document.pathItems. Its parent is the
layer or group, and length, [i], index and getByName read only that
container's paths, so a path inside a group, a compound path or a
sublayer is not listed.
- add() and the shape creators put the new path on top of the layer's or
group's contents and leave the current layer as it was. The path is
made with the container's layer current (layer.setCurrent) and, for a
group, moved into it with node.move, in the run's one undo step.
- VectorCraft's own rule: a layer or group that is hidden or locked, or
that is in a hidden or locked layer or group, throws "Cannot add a path
to a hidden or locked layer or group" and no path is made.
- The last four path lists stay cached while their documents are
unchanged, so a loop over a large layer or group builds its list once.
Docs: docs/mcp.md, docs/target-app-parity.md.
- remove() on the last path of a compound path keeps the compound path,
empty, as move() does, so a script that holds it can still read it.
edit.clear takes keepEmpty: true for this, and passes it on to
path.deleteAnchors when it deletes direct-selected anchors; without
it, Clear still deletes a compound path it empties.
- note, like name, takes a number or a Boolean as the text String()
gives it.
- Assigning a graph mark or label the opacity it already has throws
Cannot edit in a hidden or locked layer when the graph keeps another
opacity for its series or kind, since the assignment would still
change the graph.
- Only the exact opacity the getter reports counts as the opacity an
object already has; a value that differs from it by less than 0.0001
is now applied instead of being dropped.
- Reading a document's selection orders only the selected objects, by
their place in the tree, so its cost no longer grows with the size of
the document.
- docs/mcp.md: the opacity exception, note, keepEmpty, and that
strict-mode code throws a TypeError when it assigns a member an object
lacks.
Docs: docs/mcp.md.
- zOrder() on an object in a hidden or locked layer throws Cannot edit
and changes nothing, as the other setters do.
- Assigning an object the opacity it already has no longer throws when
its layer is hidden or locked. hidden and locked are still refused
there, whatever the value.
- The docs say that a top-level var selection = ... assigns the
selection, that the selection order and the tab order of documents
differ from the objectReferences page, and that assigning a member a
collection lacks throws Not found.
Docs: docs/mcp.md.
A path in a pixel-aligned compound path has no pixel alignment of its
own. When node.move or move put it into another compound path, the new
compound path did not become pixel-aligned, although it takes the paint
the path was drawn with. It now becomes pixel-aligned when the path or
the compound path it leaves was. The node.move params text and
docs/mcp.md say so.
- A path that node.move, move or duplicate puts into a compound path
loses its own paint, live shape and pixel alignment, as Make Compound
Path leaves its paths; the compound path becomes pixel-aligned when
the path was. An empty compound path takes the paint the first path
was drawn with: the path's own, or that of the compound path it
leaves.
- A path that node.move or move takes out of a compound path into a
layer or a group takes the compound path's paint and pixel alignment,
as Release Compound Path gives them to its paths. Before, it kept the
empty paint Make Compound Path left it and drew nothing.
- Artboard.name = '' gives the artboard its default name, Artboard N, as
artboard.setProps gives a blank name, instead of throwing.
- The undo step of object.newGroup is named through `label`, so the
translators' list reads Compound Path as well as Group.
- Tests: a compound path's pathItems list the topmost path first, and a
path duplicated into a compound path keeps no paint, live shape or
pixel alignment of its own.
Docs: docs/mcp.md (the order rule names the document's lists; move,
duplicate and node.move name a compound path as a place).
- Assigning hidden, locked, position, left, top, width or height to an
object in a hidden or locked layer throws Cannot edit, as opacity
does, and changes nothing. Its name and note still change.
- An object with nothing in it, such as an empty group or a compound
path whose paths moved out, reads its bounds, position, width and
height as zeros, and assigning them does nothing, so reading every
property for-in lists does not throw on it.
- Assigning selection without app. sets the active document's
selection, and app.selection can be assigned the same way. Assigning
activeDocument without app. activates a document, and assigning
documents keeps its value.
- JSON.stringify writes a collection, or data that holds one, without
reading toJSON through the collection's name lookup, which threw
Not found.
- The docs state that Object.keys, Object.getOwnPropertyNames and
Object.getOwnPropertyDescriptor do not report the members, that a
value assigned to a member the class lacks is not kept, and that the
selection order is VectorCraft's own rule.
Docs: docs/mcp.md, docs/target-app-parity.md.
Scripts that check a member with hasOwnProperty before using it skipped
every page item, because the members live on the class prototype. Now
hasOwnProperty and propertyIsEnumerable are true for each member of an
object's class that is available, and for-in lists its properties but
not its methods. Members that only throw "not available yet" stay false.
- An empty selection is an empty list instead of null.
- pageItems lists art topmost first, as the CMYKColor example reads the
frontmost path as pathItems[0]
(https://ai-scripting.docsforadobe.dev/jsobjref/CMYKColor/). A
document's selection lists the selected objects in that order too,
whatever order they were picked in. That selection order is
VectorCraft's own rule.
- A collection read with a name, such as pageItems["Logo"], gives what
getByName gives, as
https://ai-scripting.docsforadobe.dev/scriptingJavascript/objectReferences/
shows. A name nothing has throws Not found, and assigning to such a
name throws the same error.
- activeDocument, documents and selection can be named without app., as
that page describes for the application's members.
- move() with the object itself and PLACEBEFORE or PLACEAFTER leaves it
where it is and adds no undo step.
- move() keeps a compound path whose last path moves out, so a script
that holds it can still read it.
- Assigning opacity to an object in a hidden or locked layer throws
Cannot edit and changes nothing.
- name takes a number or a Boolean as its text.
- String() of an object gives its class and name, such as
[PathItem Logo].
Docs: docs/mcp.md, docs/target-app-parity.md.
- layers.add() and activeLayer = layer keep the layer the script made
current after the call, instead of putting the earlier current layer
back with the selection.
- A layer's or artboard's name takes a number or a boolean as String()
writes it. Two artboards may now have the same name.
- A layer's or group's pageItems, groupItems and compoundPathItems, and a
compound path's pathItems, list the topmost object first.
- compoundPathItems.add() makes an empty compound path
(https://ai-scripting.docsforadobe.dev/jsobjref/CompoundPathItems/).
object.newGroup takes compound: true for it, and node.move and
PageItem.move put paths into it; the first path gives an empty
compound path its paint. Other objects are refused.
pageItems walked into groups and compound paths only, so the objects inside a blend,
an envelope, a repeat or an intertwine were missing from length, [i], index and
getByName, although each of them reports that container as its parent. The walk now
goes into every container's children.
- Document.selection and PageItem.selected refuse a path made into a
guide while Lock Guides is on, instead of passing the check and then
selecting nothing. The locked artboards are measured once per
assignment.
- An edit whose command selects the objects it changes puts the current
layer and the highlighted Layers panel rows back as they were.
layer.setCurrent takes keepRows, which leaves the highlighted rows as
they are.
- move on an object on a locked artboard throws Cannot move, as editable
reads false for it. duplicate, with or without a relative object, on a
hidden or locked object or an object on a locked artboard throws
Cannot duplicate and makes no copy.
- When move takes the last path out of a compound path, the empty
compound path is deleted in the same undo step.
- addDocument writes each warning from reading the profile's file to the
Script Console as addDocument: <warning>, and a previewMode of
PixelPreview throws an error that says it is not available yet.
The removeAll() of a layer's or group's pageItems, and of groupItems and
compoundPathItems, checked only for hidden or locked objects, so it
deleted art on a locked artboard that remove() and the document's
pageItems.removeAll() refuse. It now refuses those objects with the same
error before anything is deleted, and records no undo step.
- layers.add, groupItems.add and artboards.add read the new object's id or
index from the command's own result. Read from the script's copy, an id
past 2^53 lost precision, and the new layer or group came back stale or
null.
- script.run's activeArtboards also lists a document whose active artboard
has another index at the end of the run, because artboards were inserted,
removed or reordered before it, so the view shows the same artboard.
- After a run, the Artboard tool takes the view's active artboard again.
The end of a run starts the tool afresh, which made artboard 0 the tool's
active artboard whatever the view or the script had chosen.
The object model kept only the last list of art it built, so a loop that
read doc.groupItems[i] and then that group's pageItems rebuilt the
document-wide list of groups on every step. It now keeps the last four
lists, each while its document is unchanged, and drops a document's
older lists when it builds one for a newer version of that document.
Assigning PageItem.opacity skipped object.setProps when the item already
had that opacity, so a graph mark or label set to the opacity it shows
left the graph keeping the opacity another mark of its series or kind had
set. The setter now leaves the no-op check to object.setProps, as the
command does for that case. A value within the getter's rounding of the
item's opacity sends the opacity the item has, so assigning the opacity a
script read back still changes nothing and adds no undo step.
- PageItem.editable is false for art on a locked artboard, as remove()
refuses it. A group on a locked artboard is measured once for all its
members.
- The lists of page items are kept for the last four documents read, so
a script that reads two documents in turn does not walk each one again
on every index.
A New Document profile file that is a link or a folder is no longer read:
the read is exempt from a script's file gate, which never checked where a
link leads. file.new reports it as a profileError with the reason "not a
plain file".
Reading a DocumentPreset setting now counts the value it returns toward
the data a run may pass, as assigning it does, and addDocument counts the
preset's settings before copying them.
The removeAll() test on a locked artboard now also holds an object on an
unlocked artboard and checks it is still there after the call throws.
Setting a page item's `selected` rebuilt the selection with select.set,
which selects every object whole, so the direct-selected anchors and
segments of the other selected objects were lost. When another object
has some, the selection is now rebuilt the way an edit restores it,
with only the item added or removed.
artboardLayout.rows rounded a fractional count and lowered a count over
1000 to 1000, so file.new made a different grid from the one asked for.
It now throws for both, and docs/mcp.md states the range.
PageItem.remove() and PageItems.removeAll() checked only whether the
object and its layers and groups were shown and unlocked, then passed the
ids to edit.clear, which deletes named objects without checking artboard
locks. Both now throw "cannot delete objects on a locked artboard" with
the object ids and delete nothing, as art on a locked artboard is not
editable elsewhere in the document.
Setting selected to true or false runs select.add or select.toggle for that one object, so the
other objects keep their direct-selected anchors and segments and the key object. Before, it
replaced the selection with whole objects.
- new DocumentPreset() now makes an object of the DocumentPreset class whose settings the run
keeps, so addDocument refuses a plain object, one with a typename of DocumentPreset included,
with a TypeError naming presetSettings.
- When file.new reports a profileError, addDocument throws an error that names the profile and
the reason, and the document made with the defaults is put back.
- A script's file.new reads the New Document profile file in the app's own profiles folder;
the automation roots in force still apply. Before, the script's file gate refused the folder,
so a scripted addDocument never used an edited profile.
Docs: docs/mcp.md.
- hasSelectedArtwork = false deselects only the layer's art with
select.toggle, and true adds its art with select.add, so selected ruler
guides and art on other layers stay selected. A layer with nothing to
deselect or add runs no command.
- A compound path's pathItems report the typename PathItems.
- An artboard rectangle with an edge more than 4,000,000 points from the
document origin throws before artboard.setProps or artboard.new runs.
- script.run's activeArtboards gives each document's active artboard as
the run leaves it, also when the chosen artboard was deleted later in
the run.
- A layer's or group's pageItems, groupItems and compoundPathItems, and
the document's groupItems and compoundPathItems, keep their last list
while the document is unchanged, so indexed reads in a loop do not
rebuild it each time. A new list is charged by the objects it looks at.
- object.newGroup's help says index 0 goes directly above the clipping
path in a clipping layer or group.
Docs: docs/mcp.md, docs/target-app-parity.md.
remove() on an object that is hidden or locked, sits in a hidden or locked layer or group, or is a group holding such an object now throws and deletes nothing, the same rule pageItems.removeAll() applies. docs/mcp.md states both rules and that width and height scale along the page's axes.
A rotated rectangle given a width and then a height through the scripting object model reads back the values set, its geometric bounds have that size, and other objects stay as they were. The resize doc comment names the page's axes.
A document now has layers, activeLayer, groupItems, compoundPathItems and
artboards, and every page item has its layer.
- Layers and sublayers: add, remove, removeAll, getByName, index, name,
visibility, lock, print, preview, dim images, opacity, color, stacking,
move and zOrder, each through the existing layer and node commands.
- Groups: clipped makes or releases the clipping mask, and
groupItems.add() makes an empty group through the new narrow command
object.newGroup. A document's groupItems and compoundPathItems hold
every group or compound path at any depth; a layer's or group's hold
only the ones directly in it.
- Artboards: add, insert, remove, getByName, rectangles, names, ruler
origin, pixel aspect ratio and display options, and the active
artboard. A new artboard gets an "Artboard N" name no other artboard
has. setActiveArtboardIndex adds no undo step; script.run's report
lists the change in activeArtboards and the app shows it.
- Bad values throw before any command runs, and a value a layer or
artboard already has runs no command. Handles to a deleted layer or
artboard throw Stale layer or Stale artboard.
Docs: docs/mcp.md, docs/gaps.md, docs/target-app-parity.md.
artboardSpacing is refused above 100,000 points, the limit file.new
applies, so a value file.new would refuse throws a RangeError that names
artboardSpacing.
Document.pathItems lists a document's paths and makes empty paths,
rectangles, rounded rectangles, ellipses, polygons and stars with the
parameter order and defaults of the PathItems help page. A PathItem
reads and changes its points, closed state, fill rule, area, length,
fill and stroke colors, stroke options and overprint, and translates,
rotates and resizes. PathPoints and PathPoint read and set each
point's anchor, handles and type. RGBColor, CMYKColor, GrayColor,
LabColor and NoColor make colors; a gradient, spot or pattern paint
reads as GradientColor, SpotColor or PatternColor.
Each change runs an existing command (path.create, the shape.*
commands, path.setAnchors, path.close, path.setFillRule,
paint.setFill, paint.setStroke, stroke.set, object.setOverprint,
object.move, object.rotate, object.scale) inside the run's one undo
step, and puts back the selection and the paint for new art. A value
that changes nothing runs no command; a bad value throws and changes
nothing.
path.setAnchors now makes an anchor a corner when it is given
`smooth: false`; before, the key was ignored and handles in line made
it smooth.
The host name test now has rows for app, the document model classes and the enumerations the script host adds. zOrder on a path inside a compound path throws an error and leaves the document unchanged, as duplicate does.
- An edit a script makes puts back a Layers panel target, an object
chosen inside a dynamic symbol instance and an object chosen in an
Objects on Path group, each with its own selection command.
- Assigning a document's selection selects a symbol instance or an
Objects on Path group as a whole when one of its objects was chosen.
- file.newPresets lists a grid by column's rows as set, also when there
are fewer artboards than rows, and New Document's Columns shows the
columns those rows give the current number of artboards.
- docs/roadmap.md's M13 row names the script object model that is
available.
- duplicate() runs Edit > Duplicate, the place and the selection
restore under one savepoint, so a refused place leaves the documents,
the selection and the undo history as they were. It reads the copy's
id from the command's own result, so ids above 2^53 return the copy.
A path inside a compound path throws an error instead of copying the
whole compound path.
- An edit restores a mixed selection (direct-selected anchors and whole
objects) in its original order with one select.anchorsMany.
- Assigning the selection clears a Layers panel target.
- A call on an inactive document switches back even when the selection
restore fails.
- documents.add with a grid by column passes the row count to file.new,
which takes a new artboardLayout.rows key: 5 artboards in 4 rows give
columns of 4 and 1. A preset keeps the rows until columns without
rows, or another layout, is given, and New Document drops them when
Columns or the layout changes.
- A held page item stays the same object when its class changes in the
same family (a placed image that is embedded becomes a RasterItem).
- A waiting class member's answer is read as a class instance, and a
class constructor called with new cannot wait.
Docs: docs/mcp.md (DocumentPreset, duplicate, file.new rows), docs/gaps.md
(G6).
Scripts get an app object with its documents, the active document and its
selection, and the page items of a document, read and edited through
commands so each edit is one undo step and is journaled. Host classes in
the JavaScript engine give each document or item one object while a script
holds it, answer `in` and indexed reads, and throw on stale objects and on
members that are not available yet.
Docs: docs/mcp.md, docs/target-app-parity.md.