Photo kit command

slice.new

Slice Tool

Adds a user web slice at `rect` with slice options (name, kind, URL, target, alt text); answers the slice.

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

Parameters

Parameters of slice.new
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.
heightnumbernopixels
horizontalAlignintegerno0 to 4
kind"image" | "noImage" | "table"no
messageanyno
namestringno
outsetsnumber[]no[t, l, b, r]
rectnumber[]noone of several alternative parameters
targetstring | objectno
urlstringno
verticalAlignintegerno0 to 4
widthnumbernopixels
xnumbernopixels; with y, width, height instead of rect; one of several alternative parameters
ynumbernopixels

Call through photo_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: alt, background, cellText, cellTextIsHtml, coalesce, height, horizontalAlign, kind, message, name, outsets, rect, target, url, verticalAlign, width, x, y. 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"
    },
    "height": {
      "description": "pixels",
      "type": "number"
    },
    "horizontalAlign": {
      "description": "0 to 4",
      "type": "integer"
    },
    "kind": {
      "enum": [
        "image",
        "noImage",
        "table"
      ],
      "type": "string"
    },
    "message": {},
    "name": {
      "type": "string"
    },
    "outsets": {
      "description": "[t, l, b, r]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "rect": {
      "description": "one of several alternative parameters",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "target": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "url": {
      "type": "string"
    },
    "verticalAlign": {
      "description": "0 to 4",
      "type": "integer"
    },
    "width": {
      "description": "pixels",
      "type": "number"
    },
    "x": {
      "description": "pixels; with y, width, height instead of rect; one of several alternative parameters",
      "type": "number"
    },
    "y": {
      "description": "pixels",
      "type": "number"
    }
  },
  "returns": "{slice, number}",
  "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.