Photo kit command

slice.set

Slice Options…

Changes slice options of `slice` (or auto slice `number`, which becomes a user slice): name, kind, URL, target, alt, cell text.

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

Parameters

Parameters of slice.set
NameTypeRequiredDescription
altanyno
backgroundstringnonone or #rrggbb
cellTextstringno
cellTextIsHtmlanyno
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
horizontalAlignintegerno0 to 4
kind"image" | "noImage" | "table"no
messageanyno
namestringno
numberintegernoan auto slice is promoted; one of several alternative parameters
outsetsnumber[]no[t, l, b, r]; layer slices
rectnumber[]nomove/resize; a layer slice becomes a user slice
sliceintegernoan id; one of several alternative parameters
targetstring | objectno
urlstringno
verticalAlignintegerno0 to 4

Call through photo_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: alt, background, cellText, cellTextIsHtml, coalesce, horizontalAlign, kind, message, name, number, outsets, rect, slice, target, url, verticalAlign. 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": {
    "alt": {},
    "background": {
      "description": "none or #rrggbb",
      "type": "string"
    },
    "cellText": {
      "type": "string"
    },
    "cellTextIsHtml": {},
    "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"
    },
    "horizontalAlign": {
      "description": "0 to 4",
      "type": "integer"
    },
    "kind": {
      "enum": [
        "image",
        "noImage",
        "table"
      ],
      "type": "string"
    },
    "message": {},
    "name": {
      "type": "string"
    },
    "number": {
      "description": "an auto slice is promoted; one of several alternative parameters",
      "type": "integer"
    },
    "outsets": {
      "description": "[t, l, b, r]; layer slices",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "rect": {
      "description": "move/resize; a layer slice becomes a user slice",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "slice": {
      "description": "an id; one of several alternative parameters",
      "type": "integer"
    },
    "target": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "url": {
      "type": "string"
    },
    "verticalAlign": {
      "description": "0 to 4",
      "type": "integer"
    }
  },
  "returns": "the slice",
  "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.