Scripts: pathItems.removeAll() refuses paths on a locked artboard

pathItems.removeAll() deleted paths on a locked artboard, while
pageItems.removeAll() and remove() throw for them. It now throws the
same error and deletes nothing when any path, a path in a group
included, is on a locked artboard.
This commit is contained in:
dotCooCoo committed 2026-11-25 14:27:30 -08:00
1 parent 0b155895b2
commit 199c580ca4
3 files changed
+38 -5

No files matched your search

+2 -1
View File
@@ -2804,7 +2804,8 @@ app through the global object `vc`, and writes to the Script Console and runs ot
themselves, such as a text frame's `contents`, are not defined yet and read as `undefined`.
- `Document.pathItems` (https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/) lists the document's paths in the
order of `pageItems`, paths inside groups and compound paths included, with `length`, `[i]`, `index(key)`,
`getByName(name)`, `removeAll()`, `add()` (a path with no points, from `path.create`, painted as new art; when new
`getByName(name)`, `removeAll()` (when any path is on a locked artboard, it throws
`cannot delete objects on a locked artboard` and deletes nothing), `add()` (a path with no points, from `path.create`, painted as new art; when new
art has no fill and no stroke, the path has neither), and the shape creators
`rectangle(top, left, width, height, reversed?)`, `roundedRectangle(top, left, width, height, horizontalRadius = 15,
verticalRadius = 20, reversed?)`, `ellipse(top = 100, left = 100, width = 50, height = 100, reversed?, inscribed?)`,