Layout kit command

file.inspect

Inspect Document

Answers the document's structure: pages, spreads, items with ids, stories with overset, styles, swatches and the selection. Use story.get for text.

Kit
Layout 0.1.0 (.klayout)
Changes the document
no

Parameters

None.

Call through layout_run

text
layout_run {
  "path": "<file>.klayout",
  "steps": [{ "command": "file.inspect" }]
}

The required parameters, with placeholders for their types: not a tested example. layout_run answers the step’s result in completed[i].result.

Result

Result of file.inspect
NameTypeRequiredDescription
activeLayernumberno
canRedobooleanno
canUndobooleanno
characterStylesstring[]no
dirtybooleanno
layersobject[]no
layoutsobject[]no
pageCountnumberno
paragraphStylesstring[]no
parentsobject[]no
pathanyno
selectionobjectno
settingsobjectno
spreadsobject[]no
storiesobject[]no
swatchColorsobject[]no
swatchesstring[]no
titlestringno
toolstringno
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "activeLayer": {
      "type": "number"
    },
    "canRedo": {
      "type": "boolean"
    },
    "canUndo": {
      "type": "boolean"
    },
    "characterStyles": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "dirty": {
      "type": "boolean"
    },
    "layers": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "color": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "id": {
            "type": "number"
          },
          "locked": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "printable": {
            "type": "boolean"
          },
          "showGuides": {
            "type": "boolean"
          },
          "suppressWrapWhenHidden": {
            "type": "boolean"
          },
          "visible": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "layouts": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "firstPage": {
            "type": "number"
          },
          "height": {
            "type": "number"
          },
          "name": {},
          "pages": {
            "type": "number"
          },
          "width": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "pageCount": {
      "type": "number"
    },
    "paragraphStyles": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "parents": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "number"
          },
          "items": {
            "type": "number"
          },
          "label": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "path": {},
    "selection": {
      "additionalProperties": true,
      "properties": {
        "content": {
          "type": "boolean"
        },
        "items": {
          "type": "array"
        }
      },
      "type": "object"
    },
    "settings": {
      "additionalProperties": true,
      "properties": {
        "facingPages": {
          "type": "boolean"
        },
        "intent": {
          "type": "string"
        },
        "pageHeight": {
          "type": "number"
        },
        "pageWidth": {
          "type": "number"
        }
      },
      "type": "object"
    },
    "spreads": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "index": {
            "type": "number"
          },
          "items": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "bounds": {
                  "items": {
                    "type": "number"
                  },
                  "type": "array"
                },
                "columnRule": {
                  "type": "boolean"
                },
                "columns": {
                  "type": "number"
                },
                "corner": {
                  "additionalProperties": true,
                  "properties": {
                    "shape": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "fill": {
                  "type": "string"
                },
                "fillTint": {
                  "type": "number"
                },
                "hidden": {
                  "type": "boolean"
                },
                "id": {
                  "type": "number"
                },
                "kind": {
                  "type": "string"
                },
                "layer": {
                  "type": "number"
                },
                "locked": {
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "opacity": {
                  "type": "number"
                },
                "story": {
                  "type": "number"
                },
                "stroke": {
                  "additionalProperties": true,
                  "properties": {
                    "swatch": {
                      "type": "string"
                    },
                    "weight": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "pages": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "background": {},
                "bounds": {
                  "items": {
                    "type": "number"
                  },
                  "type": "array"
                },
                "columns": {
                  "type": "number"
                },
                "index": {
                  "type": "number"
                },
                "margins": {
                  "additionalProperties": true,
                  "properties": {
                    "bottom": {
                      "type": "number"
                    },
                    "inside": {
                      "type": "number"
                    },
                    "outside": {
                      "type": "number"
                    },
                    "top": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "name": {
                  "type": "string"
                },
                "parent": {
                  "type": "string"
                },
                "side": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "stories": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "frames": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "id": {
            "type": "number"
          },
          "length": {
            "type": "number"
          },
          "lines": {
            "type": "number"
          },
          "overset": {
            "type": "boolean"
          },
          "paragraphs": {
            "type": "number"
          },
          "preview": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "swatchColors": {
      "items": {
        "additionalProperties": true,
        "properties": {
          "color": {},
          "kind": {
            "type": "string"
          },
          "locked": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "swatches": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "title": {
      "type": "string"
    },
    "tool": {
      "type": "string"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (layout_commands through @kition/[email protected], built from KitionAI/kition-layout@8767a18). As data: commands.jsonl.