photoshop_set_active_document
Switch the active Photoshop document by ID, index, or name to ensure edits target the correct open file when working across multiple tabs.
Instructions
Switch the active document tab by document_id (preferred), zero-based index, or name.
Use when: working across multiple open files and mutations must target a specific document. Do NOT use when: only one document is open — it is already active. Do NOT use document_name when duplicate names exist — use document_id from photoshop_list_documents.
Returns: JSON { ok, summary, details: { activated: { id, name }, context } }. Preconditions: target document must be open. Provide exactly one of document_id, index, or document_name. Side effects: changes active tab.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | Zero-based tab order index (leftmost tab is 0) | |
| document_id | No | Unique internal document id from photoshop_list_documents (preferred) | |
| document_name | No | Document name/title (ambiguous if multiple tabs share the same name) |