photoshop_set_text_ranges
Apply mixed fonts, sizes, and colors inside a single Photoshop text layer by setting character ranges, so one layer can hold mixed type or multicolor text.
Instructions
Apply mixed fonts, sizes, and colors inside a single text layer (Action Manager textStyleRange).
Users often say: mixed type, two fonts in one line, multicolor text, 混排, 同一文字层.
Use when: one layer must contain more than one font or color. from is inclusive, to is exclusive (JavaScript slice / ExtendScript string indexes). Do NOT use when: the whole layer shares one style — use photoshop_set_text_style. Do NOT split into extra layers for mixed type unless this tool errors.
Returns: JSON { ok, summary, details: { style, ranges } }. Preconditions: active text layer. Unspecified gaps keep the layer default style. Side effects: rewrites character styles; restores tracking/leading/box afterward.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ranges | Yes | Non-overlapping character spans (from inclusive, to exclusive) | |
| 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. |