photoshop_select_rectangle
Create a rectangular pixel selection from corner coordinates to mask, crop a region, or prepare a layer mask. Combine it with the current selection using replace, add, subtract, or intersect modes.
Instructions
Create a rectangular pixel selection from corner coordinates.
Use when: masking, cropping a region, or preparing for layer mask. Do NOT use when: subject isolation is needed — use photoshop_recipe_remove_background.
Returns: selection bounds [left, top, right, bottom]. Preconditions: active document. Side effects: replaces, adds, subtracts, or intersects the current selection. mode intersect/add/subtract uses Action Manager and does not depend on the SelectionType enum.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | Yes | Top edge in pixels | |
| left | Yes | Left edge in pixels | |
| mode | No | How this rectangle combines with the current selection. Default replace. Use intersect when SelectionType.INTERSECT is unavailable. | |
| right | Yes | Right edge in pixels | |
| bottom | Yes | Bottom edge in pixels | |
| document_id | No | Optional Photoshop document id from photoshop_get_state / photoshop_list_documents. When set, the tool activates that document before running so a UI tab switch cannot retarget the edit. |