---
title: "layer.copyToDocument: Copy Layers to Document — Photo kit command — Kition"
description: "Copies the selected layers into another open document (`document`, index from 0), optionally centered or placed `at` a point."
canonical: "https://developer.kition.ai/docs/kits/photo/commands/layer.copyToDocument"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/photo/commands/layer.copyToDocument](https://developer.kition.ai/docs/kits/photo/commands/layer.copyToDocument)

# 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); reference: [Photo kit commands](https://developer.kition.ai/docs/kits/photo.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `at` | `number[]` | no | centre the copies on this point |
| `center` | `boolean` | no | centre on the destination's canvas |
| `coalesce` | `string` | no | Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one. |
| `document` | `integer` | no | a position counted from 0 (the first is 0); destination |
| `layers` | `any` | no | [id,…]?=the source's selected layers; default the source's selected layers |
| `offset` | `any` | no | [dx,dy]?=[0,0] (from their place in the source); from their place in the source; default [0,0] |
| `source` | `any` | no | index?=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/photo-darwin-arm64@0.1.0 and the kit itself (photo_commands through @kition/cli@0.1.1, built from KitionAI/kition-photo@abe3f30).
