Vector kit command

file.new

New…

Creates a new document and makes it active, optionally from a named preset with its own size, units, orientation, artboards, bleed and colour mode; answers the new document's index. Use file.open for an existing file.

Kit
Vector 0.1.0 (.kvector)
Changes the document
yes

Parameters

Parameters of file.new
NameTypeRequiredDescription
artboardLayoutobjectnodefault: all in one row
artboardsintegerno1–1000
backgroundContentsstringnolike transparent; one of several alternative parameters
bleednumber | number[] | objectno
cmykanynoa CMYK document starts with CMYK swatches and stores the colours applied to it as CMYK; one of several alternative parameters
colorModestringnolike rgb; one of several alternative parameters
creatednumber | nullno
heightnumbernopoints
landscapeanynoswaps width and height to match; one of several alternative parameters
namestringno
orientationstringnolike portrait; one of several alternative parameters
presetstringno
previewMode"default" | "pixel" | "overprint"nooverprint turns Overprint Preview on, pixel Pixel Preview in the app; default leaves both
rasterEffectsPpi72 | 150 | 300no1–2400
titlestringno
units"Pixels" | "Points" | "Picas" | "Inches" | "Millimeters" | "Centimeters" | "Feet" | "Yards" | "Meters" | "Feet & Inches"nodefault: prefs unitsGeneral, as print presets; screen presets: Pixels
whiteanynoa white artboard background, not an object; one of several alternative parameters
widthnumbernopoints; default 612|"210 mm"

Call through vector_run

text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "file.new" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: artboardLayout, artboards, backgroundContents, bleed, cmyk, colorMode, created, height, landscape, name, orientation, preset, previewMode, rasterEffectsPpi, title, units, white, width. vector_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": {
    "artboardLayout": {
      "additionalProperties": true,
      "description": "default: all in one row",
      "properties": {
        "columns": {
          "type": "integer"
        },
        "layout": {
          "enum": [
            "gridByRow",
            "gridByColumn",
            "row",
            "column"
          ],
          "type": "string"
        },
        "rightToLeft": {
          "type": "boolean"
        },
        "spacing": {
          "default": 20,
          "description": "points",
          "type": "number"
        }
      },
      "type": "object"
    },
    "artboards": {
      "description": "1–1000",
      "type": "integer"
    },
    "backgroundContents": {
      "description": "like transparent; one of several alternative parameters",
      "type": "string"
    },
    "bleed": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "cmyk": {
      "description": "a CMYK document starts with CMYK swatches and stores the colours applied to it as CMYK; one of several alternative parameters"
    },
    "colorMode": {
      "description": "like rgb; one of several alternative parameters",
      "type": "string"
    },
    "created": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "height": {
      "default": 792,
      "description": "points",
      "type": "number"
    },
    "landscape": {
      "description": "swaps width and height to match; one of several alternative parameters"
    },
    "name": {
      "type": "string"
    },
    "orientation": {
      "description": "like portrait; one of several alternative parameters",
      "type": "string"
    },
    "preset": {
      "type": "string"
    },
    "previewMode": {
      "description": "overprint turns Overprint Preview on, pixel Pixel Preview in the app; default leaves both",
      "enum": [
        "default",
        "pixel",
        "overprint"
      ],
      "type": "string"
    },
    "rasterEffectsPpi": {
      "description": "1–2400",
      "enum": [
        72,
        150,
        300
      ],
      "type": "integer"
    },
    "title": {
      "type": "string"
    },
    "units": {
      "description": "default: prefs unitsGeneral, as print presets; screen presets: Pixels",
      "enum": [
        "Pixels",
        "Points",
        "Picas",
        "Inches",
        "Millimeters",
        "Centimeters",
        "Feet",
        "Yards",
        "Meters",
        "Feet & Inches"
      ],
      "type": "string"
    },
    "white": {
      "description": "a white artboard background, not an object; one of several alternative parameters"
    },
    "width": {
      "description": "points; default 612|\"210 mm\"",
      "type": "number"
    }
  },
  "returns": "{index, previewMode}; the size is remembered in file.newPresets' Recent",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (vector_commands through @kition/[email protected], built from KitionAI/kition-vector@7cf908f). As data: commands.jsonl.