Scripts: hasSelectedArtwork selects inside an isolated group and charges its scans

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.
This commit is contained in:
dotCooCoo committed 2026-12-02 18:44:27 -08:00
1 parent 15cc3b048f
commit 27e10129bd
3 files changed
+91 -4

No files matched your search

+3
View File
@@ -3309,6 +3309,9 @@ through `$`:
deselects only the layer's art (`select.toggle`); the rest of the selection, ruler guides included, stays. A layer
with nothing to add or deselect runs no command. Each assignment counts the current selection toward the script's
operation budget, and `true` also counts every node of the layer it looks at, hidden and locked ones included.
While an object in the layer is isolated, `true` adds what Select All takes in isolation: the art inside an
isolated group, or the isolated object itself. Reading `hasSelectedArtwork` counts each selected object it checks
toward the same budget.
`clipped = true` makes the group's topmost object, which must be a path, a compound path or type, its clipping
path; `false` releases the mask; the group keeps its id. Changes are refused when the group or its layer is
hidden or locked, or its artboard is locked. A scoped `removeAll()` that leaves a clipping group or layer