Photo kit command

layer.copyToDocument

Copy Layers to Document

Copies the selected layers into another open document (`document`, index from 0), optionally centered or placed `at` a point.

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

Parameters

Parameters of layer.copyToDocument
NameTypeRequiredDescription
atnumber[]nocentre the copies on this point
centerbooleannocentre on the destination's canvas
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
documentintegernoa position counted from 0 (the first is 0); destination
layersanyno[id,…]?=the source's selected layers; default the source's selected layers
offsetanyno[dx,dy]?=[0,0] (from their place in the source); from their place in the source; default [0,0]
sourceanynoindex?=active; default active

Call through photo_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: at, center, coalesce, document, layers, offset, source. 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": {
    "at": {
      "description": "centre the copies on this point",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "center": {
      "default": false,
      "description": "centre on the destination's canvas",
      "type": "boolean"
    },
    "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"
    },
    "document": {
      "description": "a position counted from 0 (the first is 0); destination",
      "type": "integer"
    },
    "layers": {
      "description": "[id,…]?=the source's selected layers; default the source's selected layers"
    },
    "offset": {
      "description": "[dx,dy]?=[0,0] (from their place in the source); from their place in the source; default [0,0]"
    },
    "source": {
      "description": "index?=active; default active"
    }
  },
  "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.