Photo kit command

text.paragraphStyle.new

New Paragraph Style

Creates a paragraph style (alignment, indents, spacing plus character attributes) from `attrs` or the selected text (`fromSelection`), optionally applying it; answers its id.

Kit
Photo 0.1.0 (PSD, PSB, or .kphoto)
Changes the document
yes

Parameters

Parameters of text.paragraphStyle.new
NameTypeRequiredDescription
applybooleanno
atnumber[]noInstead of `layer`: a point [x, y] in image pixels; the command acts on the topmost visible layer, not fully locked, with a pixel there (the Move tool's Auto-Select).
attrsobjectno"size_pt":36,"font_family":"Inter","align":"Center",…; "size":36,"font":"Inter","color":"#rrggbb","align":"center",…
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
fromSelectionbooleannostart from the targeted text's formatting
layerinteger | stringnoThe layer: its id as inspect lists it, "#n" (the n-th layer of the image's top level as inspect lists it, counted from the top: "#1" is the top one), or its whole name when no other layer has it; the active layer by default.
layersinteger[]nodefault: the selected type layers; one of several alternative parameters
namestringno
rangenumber[]no[startChar, endChar]; one layer; default all text

Call through photo_run

text
photo_run {
  "path": "<file>.psd",
  "steps": [{ "command": "text.paragraphStyle.new" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: apply, at, attrs, coalesce, fromSelection, layer, layers, name, range. photo_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "apply": {
      "default": false,
      "type": "boolean"
    },
    "at": {
      "description": "Instead of `layer`: a point [x, y] in image pixels; the command acts on the topmost visible layer, not fully locked, with a pixel there (the Move tool's Auto-Select).",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "attrs": {
      "additionalProperties": true,
      "description": "\"size_pt\":36,\"font_family\":\"Inter\",\"align\":\"Center\",…; \"size\":36,\"font\":\"Inter\",\"color\":\"#rrggbb\",\"align\":\"center\",…",
      "type": "object"
    },
    "coalesce": {
      "description": "Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.",
      "type": "string"
    },
    "fromSelection": {
      "default": true,
      "description": "start from the targeted text's formatting",
      "type": "boolean"
    },
    "layer": {
      "description": "The layer: its id as inspect lists it, \"#n\" (the n-th layer of the image's top level as inspect lists it, counted from the top: \"#1\" is the top one), or its whole name when no other layer has it; the active layer by default.",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-index": "#",
      "x-khp-index-order": "reversed",
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "layers": {
      "description": "default: the selected type layers; one of several alternative parameters",
      "items": {
        "description": "an id",
        "type": "integer"
      },
      "type": "array"
    },
    "name": {
      "type": "string"
    },
    "range": {
      "description": "[startChar, endChar]; one layer; default all text",
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "returns": "{\"id\",\"name\"}",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (photo_commands through @kition/[email protected], built from KitionAI/kition-photo@abe3f30). As data: commands.jsonl.