# Darty Header

To execute actions in an Illustrator document using Darty-Ai, a specially formatted .xlsx or .csv spreadsheet is required. This spreadsheet must include a Darty header, which differs from a standard single-row header.

Instead of one row, the Darty header consists of four rows that provide essential metadata and parameters for Darty methods. The fourth row is optional but must still be present.

# Structure of the Darty Header

Each of the four rows serves a distinct purpose:

# Row 1 - Tags

The first row contains Darty tags, which identify Illustrator objects targeted by Darty-Ai. Tags can be assigned to any selectable Illustrator object except layer names.

# Row 2 - Method

The second row specifies the Darty method applied to a given column or a set of related columns (a method group). A method group consists of columns that share the same method and refer to the same tag(s) defined in Row 1.

# Row 3 - Parameter

The third row defines the parameter (also referred to as a "property" or "attribute") associated with the method in Row 2.
For example, when using the transform method to reposition an object, the parameter might be x, specifying horizontal movement.

# Row 4 - Key Row

The fourth and final row, known as the key row, is primarily used for custom column identifiers. Although it can be left blank, its presence is mandatory for data import.

This row allows for custom column titles, enabling more advanced workflows. For instance, users can integrate Excel macros or script-based automation to generate Darty-compatible spreadsheets from various data sources.

# Column-Groups

Darty methods are highly versatile, often requiring multiple parameters to perform their intended function. Consequently, a method may need more than one column in a spreadsheet. Additionally, the first header row specifies Darty tags, which define the Illustrator artwork that the method will target.

A Darty column-group is a structured set of columns that contains:

  • One or more tags (Row 1) to define the Illustrator objects being targeted.
  • A method (Row 2) that specifies the action to perform.
  • Multiple parameters (Row 3) that configure the method’s behavior.

# Example: A Column-Group for Translating an Object Tagged 'dog'

A typical Darty column-group for moving an object tagged as dog might consist of three columns:

  1. Row 1 - Tags:

    • The first cell contains dog, specifying the tag.
    • The next two cells remain blank, indicating they belong to the same column-group. Darty automatically associates them with the first non-blank tag cell until another tag appears.
  2. Row 2 - Method:

    • The first cell contains transform, specifying the method.
    • Like the tags-row, the next two cells are blank, meaning they are part of the transform group.
  3. Row 3 - Parameters:

    • All three cells are filled with parameters: x, y, and angle.
  4. Row 4 - Key Row (Optional):

    • This row can either remain blank or contain unique descriptive keys for external use, such as:
      dogXmove, dogYmove, dogAngle.
  5. Following Rows - Data Values:

    • Each row beneath the header contains values corresponding to the parameters in each column:
      • x and y: Numeric values (with or without units).
      • angle: A numeric value.

By structuring data this way, Darty can efficiently process multiple parameters for a single method while maintaining clear associations between tags, methods, and properties.

This is the example Darty header featuring the above data:

dog
translate
x y angle
100 50 45

Plain-text format:

dog,,
translate,,
x,y,
,,
100,50,

This is the same example, but only the x and y parameters are used.

dog
translate
x y
100 50

Plain-text format:

dog,
translate,
x,y
,
100,50

If the intention is to move the item only in the horizontal direction or only the vertical direction, then a single x or y parameter can be used, reducing the necessary columns to one.