photoshop_select_rectangle
Create a rectangular pixel selection from corner coordinates to mask, crop, or prepare a layer mask. Set replace, add, subtract, or intersect modes to combine it with the current selection.
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 | Yes | Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call. |