After a script reads a path's points, each command makes the run look
through the changed layers and groups of the document for those paths.
That look was not counted toward the script's operation budget, so a
loop of commands on a large layer did unbounded work. It now charges the
objects it looks at, as the layer scans in layers.rs do.
- The look pairs each object with the one of the same id under the same
parent now, and lists the document once for a group that moved, so no
object is searched for through the whole document.
- A document none of whose read paths remain is no longer looked at.
The look was added in #9288.
A run whose first step is an exact document.open still reads the open
documents' linked files then, so a link retargeted while the run is paused
gives a later command no read access to the new target. The open itself
still gets no linked-file access.
- update() takes a waiting palette event only when the run's file access
roots reach the same files as the event's, so a handler never runs with
less access than its palette was shown with.
- A palette event is no longer delivered to a handler after its palette
was hidden and shown again, or after a capturing listener disabled or
hid the control or a group above it.
- A limit that ends a handler update() took restores the run's own
actions before the end-of-run refresh.
- A palette refresh that fails reports no unhandled rejection.
- A refused palette field text no longer replaces text typed after it.
- The script.run, script.palette.event and docs texts describe update()
delivery, list staleness after item edits, and repeating a click or
close dropped with an oversized text.
- A compound path's `pathItems` is a `PathItems` object scoped to the
compound path: it reads its paths, `parent` is the compound path, and
the methods that make a path throw. `removeAll()` keeps the compound
path, empty, as `remove()` of its last path does. `PathItems` gains
`toString()`.
- `GroupItem.clipped` throws when the path that would become the
clipping path, or the clipping path it would release, is hidden or
locked, before `layer.clippingMask.toggle` changes it.
- After `artboards.add` or `insert` gives the active artboard another
index, `app.doScript` steps act on that artboard at its new index. The
Artboard tool's selection kept from the run's start is held by
artboard id, so a Fit to Artwork Bounds or paste step acts on the same
artboards after one is inserted or removed.
- `Layer.opacity` runs no command only for the exact value its getter
reports, as a page item's does.
- `Layer.zOrderPosition` reads the kept list of layers and each layer's
place in it, so a loop over the layers lists them once.
- Tests: the Revert test compares the artboard's name with the saved
one, and the `clipped` test reads `clipped` inside the script after
the error.
- A handler that a palette's update() runs in a later run of the same
engine plays the actions of the run that showed the palette, as a
handler's own run does. After the handler ends, or throws out of
update(), app.doScript plays the run's own actions again.
- script_palette_start gives the app the error of an open edit that
cannot be settled, and the waiting events keep waiting; it no longer
returns None, which showed nothing.
- A palette event runs no handler or listener once a getter or an
earlier listener took its control out of the palette, and a click or
change is dropped when a getter read for the event disabled or hid
the control or a container above it.
- A palette list's change ends its run with an error when an item's
text comes from a getter, an inherited property or an object.
- The run's report of unhandled rejections is made again after the
palettes are refreshed, leaving out a rejection that a getter gave a
handler, and stays empty after a failed run.
- A text a palette's field gave stays in the field until no change of
that field waits, also while a run before the change set the field to
the same text.
- The report test replaces a waiting change ahead of another field's
change, and the modal-wait test requires that no later frame is asked
for.
- docs/mcp.md: a list's change made before the app puts it in line is
dropped without an error; an error a handler throws out of update()
can be caught, and the run then keeps the handler's changes.
- `artboards.insert` returns nothing, as the scripting reference says; `add`
still returns the new artboard.
- `toString` of `Layers`, `GroupItems`, `CompoundPathItems` and `Artboards`
checks the collection as `typename` does, so a collection whose container
is gone throws instead of stringifying.
- The collections' `index` is described as returning their element class,
with an `itemKey` of any type. `PageItems.parent` and `PathItems.parent`
are described as any type, since scoped collections return a layer or
group.
- `hasSelectedArtwork` charges the selection and every node of the layer it
looks at to the script budget, also when it runs no command.
- A document made during the run whose active artboard the run chose is
reported when an artboard inserted before it moves it.
- Tests: a test-only counter of built art lists bounds the group loop test,
and the rejected-parameter checks of `object.newGroup` compare the whole
layer tree.
A script's addDocument with previewMode OverprintPreview failed: file.new
turned the view on with view.overprintPreview, which scripts may not
run. A script's file.new now asks for the view, and the run turns
Overprint Preview on when it ends; a run that fails does not turn it on.
The images a New Document profile's symbols, patterns and brushes link
to were read under the script's file gate, after the profile's own file
was read outside it, so images beside the profile showed only their
preview. They are now read the way the profile's file is, under the
automation roots in force.
- A prompt, confirm or alert answer that cannot reach the script is listed
in the report with the answer "error" instead of the answer given.
- After a named-engine run, point changes that a palette getter makes
while the palettes are refreshed are written before the run ends.
- The promise jobs a palette getter queues during that refresh run in the
same fuel, the host gets the controls once more after them, and their
unhandled rejections are part of the run's report. An update() they
call takes no waiting event.
- A waiting text change merges with a newer one only when no click or
close of its palette waits after it.
- With nobody to ask, an open edit that cannot be finished before the run
ends script.palette.event with that error, and the event does not wait.
- A click whose onClick getter hid the palette runs no handler, and a list
choice whose list a text getter removed, or whose earlier item text a
later getter changed, is refused.
- add() and remove() on a shown palette return their result when a getter
throws while the host's copy is updated; the host gets the controls at
the next update or when the run ends.
- In the app, a palette event whose run cannot begin shows its own error
instead of an earlier stopped run's message.
- The overview comments, docs/mcp.md and the progress line describe the
update() handling, the merge rule, onClose returning false and the
named engine a palette needs.
- The 1000% scale limit applies only when Fit to Page is off, since the
scale factors are not used with it on.
- A script run clears the print command allowance when it ends, so a
panic inside print cannot leave file.print open to later runs.
- saveAs without options takes the format from the path the script
names, so a link at that path cannot change it.
- A File the host gives back charges its path to the heap.
- DocumentPreset.typename throws for a preset from an earlier run.
- Documents.addDocumentNoUI throws that it is not available yet.
- The print tests remove their folders when an assertion fails.