Adding, inserting or removing an artboard from a script now keeps the
artboard that was active before the change by its id, as
setActiveArtboardIndex does, also when the script never chose one. Before,
with no artboard chosen, an artboard inserted at index 0 became the active
one, so later app.doScript steps acted on it. A stored id of a removed
artboard no longer stops the fallback from being kept, and a document the
run made is reported when its active artboard moves.
The script run summary in docs/target-app-parity.md now says that showing
or hiding a perspective grid and its active plane add no undo step.
The document's pathItems.removeAll() skipped text whose characters are
all whitespace before laying it out, so a numbered paragraph holding a
single space did not count, although its number clips. The deletion was
then refused while the mask would still clip.
- Whitespace-only text is laid out like other text.
- Text is laid out only inside a mask that loses a path, so documents
with text outside such masks do no layout for the check.
- A test covers a mask left with only a list number.
- docs/mcp.md says blank text without a list marker does not count.
The document's pathItems.removeAll() counted any visible text object as
geometry that keeps a clipping mask clipping. Blank type and area type too
short for its first line lay out no glyphs, so the clip renderer clips by
nothing for them; deleting the mask's last path then hid the clipped art.
- Text counts only when it is visible and its layout gives glyph outlines.
- A clipping group nested in the mask counts only its first member.
- Hidden objects and members of hidden groups do not count.
- Tests cover blank, overset, hidden and nested-clipped type, and type
with glyphs that still allows the delete.
- docs/mcp.md states the rule.
A group that clips by a mask holding a path and a text object keeps
clipping by the text's outlines after the path is deleted, so
Document.pathItems.removeAll() no longer refuses that case. Hidden
text and hidden subgroups do not clip, so a mask left with only those
still refuses. docs/mcp.md describes the rule.
Document.pathItems.removeAll() deleted every path of the document even when
one was the clipping path of a group or layer that keeps other objects, so
the next object became the clipping path. The scoped collections already
refuse this. The document's collection now runs the same check before
anything is deleted, and also refuses when it would empty a compound path or
group that clips other objects. edit.clear removes an emptied compound path
and keeps an emptied group, and the check follows it.
The fault came with #9041, which added Document.pathItems.
A script that removed or inserted an artboard before the active one left
the steps app.doScript plays on the index the run started with, so an
Align to Artboard step acted on a different artboard than
getActiveArtboardIndex() and the run's report gave. Adding, inserting or
removing an artboard through artboards or Artboard.remove() now makes
playback use the active artboard by id, as setActiveArtboardIndex does,
which also follows an undo inside the run.
- The locked-artboard removeAll test reads the collections' lengths
inside the run after catching the refusal, so a delete before the
refusal fails it.
- layer.setProps and docs/mcp.md give dimImages: true as 50%.
- docs/mcp.md says artboards.insert reorders only when the new artboard
is not already at the index, and describes the playback rule.
- The Document.views progress line no longer says Type is missing.
`removeAll()` on the `pathItems` of a compound path deleted every path even
when the compound path was the clipping path of a group or layer that keeps
other objects, which left an empty clipping path. It now throws the same
"cannot delete a clipping path" error that deleting the clipping path itself
gives, and deletes nothing. The collection `removeAll()` came in with #9048.
While a group is isolated, `layer.hasSelectedArtwork = true` looked only at
the layer's top-level art, which is not selectable in isolation, so it
selected nothing. It now takes what Select All takes in isolation: the art
inside the isolated group (through any sublayer it holds), or the isolated
object itself, and nothing when the isolated object or what holds it is
hidden or locked. While Lock Guides is on, paths made into guides are not
counted as art to add, so they no longer trip the selection limit.
Reading `hasSelectedArtwork` now counts each selected object it checks
toward the script's operation budget, as the setter already did.
Follows #9048, which added the property.
- Layer.zOrderPosition reads the sibling list through the cached layer
lists, so reading it for every layer of a loop lists the layers once.
Each read is still charged for the search through the list.
- TextFrames.removeAll releases the mask of a group or layer whose
clipping path is one of the type objects it deletes, as
PageItems.removeAll and remove() do, so the object above the type is
not made the clipping path.
- GroupItems.createFromFile checks that its collection is still there
first, so a collection whose group was deleted throws "Stale page item"
instead of the not-available message. docs/mcp.md says so.
Assigning `clipped = true` to a GroupItem checked only that the group and
its layer were editable, so a hidden or locked topmost object lost its fill
and stroke and became the clipping path. The setter now refuses that object
before running the command, with no undo step. The setter came from #9048.
A file.new step replayed from a journal or the Actions panel rounded
artboardLayout.rows and then refused a result over 1000, so a step with
rows 1000.5 or 5000 stopped the playback. The rows count now follows the
columns rule: it is rounded, must be 1 or more, and is kept to at most
1000. Recent stores the kept count. docs/mcp.md says the same.