illustrator_query_items
Query Illustrator items by selection, layer, type, name pattern, or location, returning item references and handles for targeted follow-up edits.
Instructions
Query items using the Task Protocol with declarative target selection.
CONTRACT: readOnly=True, destructive=False, idempotent=True, openWorld=False
WHEN TO USE:
Finding items by type, name pattern, or location before modification
Inspecting current selection
Listing all items on a layer or in the document
TARGET SELECTORS: {type: "selection"} — current selection (default) {type: "layer", layer: "Layer 1"} — all items on layer {type: "all", recursive: true} — all items in document {type: "query", itemType: "PathItem", pattern: "axis_*"} — filter by type/name
EXAMPLES: Require exactly one matching text label: { "params": { "targets": { "type": "query", "contents": "alpha-helix", "expect": { "count": 1 } } } } Every path whose name starts with axis_: {"params": {"targets": {"type": "query", "itemType": "PathItem", "pattern": "axis_*"}}} Everything on a named layer: {"params": {"targets": {"type": "layer", "layer": "Layer 1"}}}
NOTES:
Returns ItemRef plus an expiring handle for exact untagged follow-up edits
Handle issuance never writes item.note or item.name
Set include_trace=True for debugging
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |