---
title: "slice.set: Slice Options… — Photo kit command — Kition"
description: "Changes slice options of `slice` (or auto slice `number`, which becomes a user slice): name, kind, URL, target, alt, cell text."
canonical: "https://developer.kition.ai/docs/kits/photo/commands/slice.set"
---

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

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

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `alt` | `any` | no |  |
| `background` | `string` | no | none or #rrggbb |
| `cellText` | `string` | no |  |
| `cellTextIsHtml` | `any` | no |  |
| `coalesce` | `string` | no | Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one. |
| `horizontalAlign` | `integer` | no | 0 to 4 |
| `kind` | `"image" \| "noImage" \| "table"` | no |  |
| `message` | `any` | no |  |
| `name` | `string` | no |  |
| `number` | `integer` | no | an auto slice is promoted; one of several alternative parameters |
| `outsets` | `number[]` | no | [t, l, b, r]; layer slices |
| `rect` | `number[]` | no | move/resize; a layer slice becomes a user slice |
| `slice` | `integer` | no | an id; one of several alternative parameters |
| `target` | `string \| object` | no |  |
| `url` | `string` | no |  |
| `verticalAlign` | `integer` | no | 0 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/photo-darwin-arm64@0.1.0 and the kit itself (photo_commands through @kition/cli@0.1.1, built from KitionAI/kition-photo@abe3f30).
