Variables: Import Data Sets reads every column as a variable and replaces the data sets

Squashed from #5151 onto main.
This commit is contained in:
dotCooCoo
2026-11-03 16:38:29 +07:00
committed by bflatastic
parent fbab0bdd43
commit 86deb546ad
8 changed files with 335 additions and 242 deletions
+7 -4
View File
@@ -1684,10 +1684,13 @@ already walks Image Trace. Short agent entry points:
renames the row, in the same undo step; Edit Data Set's Name field sends it), `dataset.rename`,
`dataset.delete`, `dataset.capture`, `dataset.update`, `dataset.select {name}`, `dataset.next` /
`dataset.prev` (each `dataset.select` / next / prev is one undo step over every bound object), `dataset.import {path|data|dataBase64|csv}` /
`dataset.export {path?}` (CSV: `name`, then one column per variable). `dataset.import` also reads tab-separated
files, and files whose first header cell isn't `name`: every header cell is then a variable, and the rows take the
first free names `Data Set 1`, `Data Set 2` and so on. An import error about a row's values or name gives the file
line the row starts on. A header cell that names no variable defines one, unbound, in the same undo step as the
`dataset.export {path?}` (CSV: one column per variable, and no column of data set names). `dataset.import` also
reads tab-separated files. Every header cell is a variable, whatever its case (`name` and `Name` included), as the
[set-up page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/set-up-data-source-files.html)
describes the first row: "Specify your data field name in the first row of your spreadsheet." The rows replace every
data set of the document and are named `Data Set 1`, `Data Set 2` and so on, in file order; the document's variables
and their bindings stay, and the reply's `deletedDataSets` lists the data sets that were replaced. An import error
about a row's values gives the file line the row starts on. A header cell that names no variable defines one, unbound, in the same undo step as the
rows. `#Shown` defines a visibility variable `Shown`, `@Photo` defines an image variable `Photo`, and a cell without
a prefix defines a text variable. `dataset.export` writes a visibility variable's header as `#Shown` and an image
variable's as `@Photo`, and a text or graph variable's as its name alone. Its reply's `warning` names the variables
+1 -1
View File
@@ -572,7 +572,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- Export for Screens, Save for Web (slice images, and files named after the document's title) and the Libraries panel name files with the characters Windows does not allow written as `-` and with a `-` after a Windows device name such as `CON`, on every platform (`document.exportForScreens`, `document.exportForWeb`, `library.create`).
- Export for Screens numbers distinct row files whose names collide, compared without case, as `-2`, `-3`… instead of leaving them out; identical rows still write one file. It puts row folders that differ only in case into one folder (`document.exportForScreens`).
- Variables (data merge): text, visibility and image variables bound to objects (an object may carry several), dataset rows applied in one undo step (`variable.*`, `dataset.*`) from a Variables panel and Window › Variables, with dialogs to define, bind and edit, Make Text/Visibility/Image Dynamic, Capture/Update Data Set, CSV import/export (`dataset.import` / `dataset.export`), and a row in italics when an edit leaves the art not matching it; an image dataset value is a file path and apply keeps the object's bounds; bindings let go of deleted art and locked art is left alone; every command, like the rest, is drivable over MCP and the CLI.
- Variables: Import Data Sets… (`dataset.import`) reads tab-separated files as well as comma-separated ones, and files without a `name` column, whose rows take the first free names Data Set 1, Data Set 2 and so on. An import error about a row's values or name gives the file line the row starts on.
- Variables: Import Data Sets… (`dataset.import`) reads tab-separated files as well as comma-separated ones. Every header cell is a variable, and the rows replace the document's data sets as Data Set 1, Data Set 2 and so on. An import error about a row's values gives the file line the row starts on.
- Variables: Import Data Sets… (`dataset.import`) defines the variables a file's header names that the document lacks, unbound. `#Shown` defines a visibility variable, `@Photo` defines an image variable, and a header without a prefix defines a text variable. A header that is a variable's exact name keeps naming it, and any other `%` header (graph data files) is refused.
- Variables: Load Variable Library… in the Variables panel menu (`variable.loadLibrary`) replaces the document's variables and data sets with a variable library's, read from its XML file, in one undo step: every variable is deleted with its bindings and values, and every data set is deleted; then the library's text variables are defined, unbound, and its data sets take the text of each value's `p` elements, one paragraph each. Variables of other kinds are left out with a warning that names their kinds.
- Variables: Save Variable Library… in the Variables panel menu (`variable.saveLibrary`) writes the document's text variables and data sets as a variable library's XML file, which Load Variable Library reads back with the same text variables, data set names and text values. Variables of other kinds are left out with a warning that names their kinds.