Assigning `matrix` to a placed or raster image ran `object.transform` on a
locked or hidden image, an image inside a locked or hidden layer or group,
and an image on a locked artboard. The transform methods (`translate`,
`rotate`, `resize`, `transform`) refuse all of these with nothing changed.
The setter now refuses them with the same errors, before the unchanged
matrix check, so assigning the current matrix to such an image throws too.
The locked artboard check uses the cached lookup that `editable` uses.
The setter came in with #9062.
Docs: docs/mcp.md.
`PathItems.index()` with a number went straight to `items_doc`, which
refuses every compound-path-scoped `PathItems` so that creating paths
there stays unavailable. Its siblings (`[n]`, `getByName`, `length`,
`removeAll`) already dispatch scoped collections to the layer handlers
first, but `index` did not, so `compoundPathItems[0].pathItems.index(0)`
threw "creating paths in a compound path is not available yet". Route a
scoped `index` to `scoped_index` like the other lookups; the guard now
only stops real creation.
Retracing and releasing a tracing discard the objects its trace made, so
both now throw "Cannot edit page item <id>" when one of them is locked,
with nothing changed. Added artwork is still reported first. The scan
stops at the first added object and charges the objects it looked at to
the run on both the success and refusal paths.
The bounds getters (position, left, top, width, height and the bounds
arrays) read an item in a document in the back without measuring its type,
while the setters measure it after the switch to that document since
#10538. A script that read t.width and assigned it back could resize the
item, and every geometry assignment switched to the document and back even
when nothing changed.
The getters now measure type not measured yet in a document in the back
for an item that holds type, a symbol instance or a placed document, the
way the switch measures it, and the check is skipped while the document is
unchanged. An assignment equal to the current value of an object without
such content in a document in the back returns without switching
documents, and no undo step is made.
A script that set PrintColorManagementOptions.colorProfileMode to
CUSTOMPROFILE and assigned no name printed with the base settings'
profile, as though no custom profile had been asked for. The job now
throws before anything is written, as it does for an empty name.
Follows up on #9087.
- move, remove() and zOrder throw "Only Image Trace can make a tracing",
with nothing changed, when they would leave an image at the bottom of
an ordinary group named Image Trace: a path moved out of the group or
to its top, Send to Back or Send Backward on the image, and Bring to
Front or Bring Forward on the object below it.
- releaseTracing() throws "Cannot release a tracing containing added
artwork", with nothing changed, when the tracing holds an object its
trace did not make. imageTrace.release keeps only the source image, so
the added object would be deleted.
- The TracingOptions members with no setting and TracingObject.areaCount
are left out of hasOwnProperty and reflect. Reading them still throws.
Docs: docs/mcp.md.
A new IllustratorSaveOptions left compatibility unset, so a script that
read it before setting it got undefined. It now starts at
Compatibility.ILLUSTRATOR19, the documented default, which saveAs already
accepts without changing what it writes.
Setting width, height, left, top or position on an item in a document in
the back measured the item before its document was made active. Making a
document active measures its type again where it is not measured yet or
where a composite font of the same name changed, so the scale ratio or the
move distance applied to bounds that no longer held, and the item ended
at a different size or place than the one asked for.
The measurement now runs inside the edit, after the switch, through a new
edit_item_with that edit_item also uses.
- `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.
- move() and duplicate() refuse to put an image at the bottom of an
ordinary group named Image Trace, before the document changes, as
renaming such a group already does. A tracing's source image moved
out keeps its own error.
- pathCount and usedColorCount no longer walk the anchor points, and
anchorCount charges each path inside a compound path it reads.
- The run keeps the reverse of its replacement map, so finding the
first object of a chain no longer scans the whole map at each step.
- docs: the source image of a traced item is left out of pageItems,
placedItems and rasterItems and is reached through
PluginItem.tracing.sourceArt; docs/mcp.md lists the new error.
File.parent gives a folder in URI notation (/c/Users/..., with %20 for a
space). $.evalFile joined that text to the script's folder as written, so
on Windows $.evalFile(File($.fileName).parent + '/more.jsx') looked under
C:\c\Users\... and reported "include file not found".
When an absolute path starting with one / names no file the script may
read, $.evalFile now also tries it with its escapes decoded and, on
Windows, with /c/... as the drive C:. The path as written is still tried
first, and the scope check, the .. refusal and the file limits apply to
every form. Share and device paths are not converted, and #include lines
are read as before.