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 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.
- PageItem.transform with changeLineWidths at the matrix's own scale sets
the stroke weight of a path whose paint the compound holds, as resize
does.
resize and transform set that weight by the scale itself, and an explicit
100 keeps the weights even for a scale within the tolerance of 100%.
- A changeLineWidths of 0 no longer matches a tiny scale; a positive value
is compared with the scale relative to its size.
- translate refuses an offset past the canvas only when the call moves the
object or a pattern it uses; a non-finite offset is still refused.
- Number conversion of preference text no longer trims U+0085, as
JavaScript does not.
- A real preference changes between 0 and -0: values are compared by their
bits in the setter and when the run's keys are merged.
- A clipboard.importSvg whose result cannot reach the script puts the
clipboard back.
- Moving an object works out its index without copying the list of its
siblings.
- The app's question before the external script warning turns off is known
by the confirm the app opened, not by its text, so a script's confirm
with the same text answers Yes through automation and is not translated.
- docs: only calls that move or reshape the object run
object.transform, and transform sets a compound member's stroke.
PathItem now takes PageItem's translate, rotate and resize: main's PathItem versions are removed, and resize on a path keeps main's changeLineWidths percent for the stroke weight. Hidden objects are refused, and an identity transform of an empty path checks its Transformation value and does nothing.