mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-01 02:35:37 +01:00
Docs: script and edit.clear notes match what the code does
- app.documents.add: artboardRowsOrCols sets the rows of GridByCol and RLGridByCol and the columns of GridByRow and RLGridByRow; Row, RLRow and Column do not use it. - PageItem.duplicate runs node.move on the copy only with a relative object, and move and duplicate skip node.move when the object is already in place. - edit.clear takes null for guides, keepEmpty and keepJoined as the key left out, as switch_or reads them. - The scripts entry in docs/target-app-parity.md no longer lists type as missing; document.textFrames ships.
This commit is contained in:
1 parent
639ce5004e
commit
4ef58e025f
2 files changed
+11
-8
No files matched your search
+10
-7
@@ -2969,8 +2969,9 @@ through `$`:
|
||||
name in that thread chooses is VectorCraft's own reading; names with no VectorCraft tool throw. `app.documents`
|
||||
(https://ai-scripting.docsforadobe.dev/jsobjref/Documents/) has `length`, `[i]`, `index(key)`, `getByName(name)`
|
||||
and `add(colorSpace?, width?, height?, numArtBoards?, artboardLayout?, artboardSpacing?, artboardRowsOrCols?)`,
|
||||
which runs `file.new` (`artboardRowsOrCols` is the number of rows for `GridByCol` and `RLGridByCol`, and of
|
||||
columns for the other layouts), and `addDocument(startupPreset, presetSettings?, showOptionsDialog?)`, which runs `file.new`
|
||||
which runs `file.new` (`artboardRowsOrCols` is the number of rows for `GridByCol` and `RLGridByCol` and the number
|
||||
of columns for `GridByRow` and `RLGridByRow`; `Row`, `RLRow` and `Column` put the artboards in one row or column and
|
||||
do not use it), and `addDocument(startupPreset, presetSettings?, showOptionsDialog?)`, which runs `file.new`
|
||||
with the New Document profile `startupPreset` names (`Print`, `Web`, `Mobile`, `Video`, another profile of
|
||||
`file.newPresets`, or `Basic CMYK` and `Basic RGB` for no profile), starting from the first preset
|
||||
`file.newPresets` lists for that profile, and the settings of a `new DocumentPreset()`
|
||||
@@ -3022,8 +3023,9 @@ through `$`:
|
||||
object that is hidden or locked, in a hidden or locked layer or group, or on a locked artboard), `zOrderPosition`,
|
||||
`duplicate(relativeObject?, insertionLocation?)`,
|
||||
`move(relativeObject, insertionLocation?)`, `remove()` and `zOrder(method)`
|
||||
(https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/). `move` runs `node.move`, and `duplicate` runs
|
||||
`edit.duplicate` and then `node.move` on the copy. The relative object is a page item or a layer of the same
|
||||
(https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/). `move` runs `node.move` unless the object is already in
|
||||
the place it names. `duplicate` runs `edit.duplicate`, and with a relative object it then runs `node.move` on the
|
||||
copy the same way; without one, the copy stays where `edit.duplicate` puts it. The relative object is a page item or a layer of the same
|
||||
document; `ElementPlacement.INSIDE` and `PLACEATBEGINNING` (the default) put the object on top of a layer's or a
|
||||
group's contents, `PLACEATEND` under them, `PLACEBEFORE` directly above the relative object and `PLACEAFTER`
|
||||
directly below it. An object of another document throws `Cross-document placement is not available`, and when
|
||||
@@ -4504,8 +4506,9 @@ or unknown id leaves the document unchanged. An empty `ids` array does nothing.
|
||||
are kept, and selecting an ancestor together with its descendants deletes that subtree once.
|
||||
Without `ids`, direct-selected anchors or selected ruler guides retain their usual Clear behavior.
|
||||
With `ids`, `guides: true` also deletes the selected ruler guides. The command rejects a `guides` value that is not a
|
||||
boolean. A compound path left with no paths is deleted too, unless `keepEmpty: true` is given, which keeps it, empty,
|
||||
also when the deleted parts are direct-selected anchors; a `keepEmpty` value that is not a boolean is rejected.
|
||||
boolean or `null`. A compound path left with no paths is deleted too, unless `keepEmpty: true` is given, which keeps
|
||||
it, empty, also when the deleted parts are direct-selected anchors; a `keepEmpty` value that is not a boolean or `null`
|
||||
is rejected. `null` for `guides`, `keepEmpty` or `keepJoined` counts as leaving the key out.
|
||||
Without `ids`, `keepJoined: true` removes the direct-selected anchors of each path that has no selected segment as
|
||||
`path.removeAnchors` does (see Removing anchor points): the path stays joined, and the next anchor along is selected
|
||||
(the one before at an open path's end). When no subpath that lost an anchor keeps two anchors, the path stays selected
|
||||
@@ -4513,7 +4516,7 @@ whole, as `path.removeAnchors` leaves it, so the next Delete removes the whole p
|
||||
cut there, and their selected anchors stay in the path, as with `keepJoined: false`; and objects selected whole are deleted, in the
|
||||
same undo step. `keepJoined` defaults to the `deleteKeepsPathsJoined` preference, and the value used joins the journal
|
||||
entry; a saved step without it opens the paths, as it did when it was recorded. With `ids`, `keepJoined` has no
|
||||
effect. A `keepJoined` value that is not a boolean is an error, with or without `ids`.
|
||||
effect. A `keepJoined` value that is not a boolean or `null` is an error, with or without `ids`.
|
||||
|
||||
`edit.copy` takes a compound-path member selected on its own (whole or in part, with Direct or Group Selection) as an
|
||||
ordinary path with the compound's paint, transparency, opacity mask and fill rule. The path is linked to the compound's
|
||||
|
||||
@@ -1132,7 +1132,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- Scripts: `PageItem.tags` reads, adds, renames and deletes an object's tags, name and value pairs that the native file keeps, and `Document.tags` reads, renames and deletes the tags of every page item but adds none (its `add` throws; a script adds a tag through the page item's `tags`), as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Tags/ and https://ai-scripting.docsforadobe.dev/jsobjref/Tag/ describe them, through `object.tags` and the `object.tag.*` commands, at most 64 tags an object (`docs/mcp.md`). `crates/engine/src/tests/script_tags.rs`.
|
||||
- Scripts: `Document.saveAs`, `Document.exportFile` and `app.open` save, export and open documents, `Document.fullName` and `saved` give a document's file and saved state, setting `saved` records that state (`document.setSaved`), `Document.path` gives its folder as a `Folder` (VectorCraft's own type), and `Document.close` closes it, saving to its file first with `SaveOptions.SAVECHANGES`, with the option classes the help pages https://ai-scripting.docsforadobe.dev/jsobjref/IllustratorSaveOptions/, https://ai-scripting.docsforadobe.dev/jsobjref/EPSSaveOptions/, https://ai-scripting.docsforadobe.dev/jsobjref/PDFSaveOptions/, https://ai-scripting.docsforadobe.dev/jsobjref/ExportOptionsPNG24/, https://ai-scripting.docsforadobe.dev/jsobjref/ExportOptionsJPEG/, https://ai-scripting.docsforadobe.dev/jsobjref/ExportOptionsSVG/, https://ai-scripting.docsforadobe.dev/jsobjref/PDFFileOptions/ and https://ai-scripting.docsforadobe.dev/jsobjref/Document/ describe (the enumerations of the options that keep their defaults included), and read and write only where the script's `File` objects may, refusing a path whose real file name is not valid UTF-8; the warnings of each save, export and open go to the console (`docs/mcp.md`). `crates/engine/src/tests/script_save_open.rs`.
|
||||
- Scripts: the global `app` gives the open documents, new documents from a startup preset and a `DocumentPreset`, the active document, each document's selection and its page items with their names, notes, visibility, lock, opacity, position, size, bounds and stacking order, and moves and copies them into or beside other objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Application/, https://ai-scripting.docsforadobe.dev/jsobjref/Documents/, https://ai-scripting.docsforadobe.dev/jsobjref/DocumentPreset/, https://ai-scripting.docsforadobe.dev/jsobjref/Document/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ describe them; each change runs a command inside the run's transaction (`docs/mcp.md`). A script can check a member with `hasOwnProperty`, and can read a collection by name and name `activeDocument`, `documents` and `selection` without `app.` (https://ai-scripting.docsforadobe.dev/scriptingJavascript/objectReferences/). A key such as `1` is an array index and reads that position; in `pageItems` and `documents`, a number that is not an array index, such as `-1` or `1.5`, is looked up by name when the key is the text JavaScript writes for that number. VectorCraft's own rule. `app.executeMenuCommand` runs the menu items Select All, Deselect, Group, Ungroup, Make and Release Clipping Mask, Make and Release Compound Path, and Fit to Artwork Bounds by their menu command names (https://community.adobe.com/questions-652/a-list-of-illustrator-menu-commands-we-can-call-from-javascript-769510, https://gist.github.com/shalakolee/df3246659d4289eb99149b9ed00a00ee). The `parent` of a page item at the top of a layer is a `Layer` with `name`, `typename` and `toString`. A page item's `blendingMode` reads and sets its blend mode with the `BlendModes` values (https://ai-scripting.docsforadobe.dev/jsobjref/scripting-constants/).
|
||||
`Document.views` lists the document's drawn windows with their bounds, center, zoom and screen mode (https://ai-scripting.docsforadobe.dev/jsobjref/View/). Zoom follows each window's displayed percentage, including display density with Display Print Size at 100% Zoom enabled; bounds retain the physical camera scale. View objects keep their targets when windows are renumbered. View changes run no command, add no undo step, and remain when a script fails. A center outside the canvas after coordinate conversion throws a `RangeError`. `Document.layers`, `Document.activeLayer`, type and the other classes are not there yet. `crates/engine/src/tests/script_dom.rs`.
|
||||
`Document.views` lists the document's drawn windows with their bounds, center, zoom and screen mode (https://ai-scripting.docsforadobe.dev/jsobjref/View/). Zoom follows each window's displayed percentage, including display density with Display Print Size at 100% Zoom enabled; bounds retain the physical camera scale. View objects keep their targets when windows are renumbered. View changes run no command, add no undo step, and remain when a script fails. A center outside the canvas after coordinate conversion throws a `RangeError`. `Document.layers`, `Document.activeLayer` and the other classes this list does not name are not there yet. `crates/engine/src/tests/script_dom.rs`.
|
||||
- Scripts: `app.redraw()` (https://ai-scripting.docsforadobe.dev/jsobjref/Application/) returns without changing the documents or adding an undo step; the app goes on drawing the documents as they were before the run until the run ends. VectorCraft's own rule. `crates/engine/src/tests/script_dom.rs`.
|
||||
- Scripts: a document's variables and data sets, the variables its page items are bound to, Lock Variables, and importing and exporting a variable library through a `File`, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Variables/, https://ai-scripting.docsforadobe.dev/jsobjref/Variable/, https://ai-scripting.docsforadobe.dev/jsobjref/Datasets/ and https://ai-scripting.docsforadobe.dev/jsobjref/Dataset/ describe them; `variable.setBinding` binds one object for one slot, and `dataset.update {name}` updates a data set that is not the active one (`docs/mcp.md`). `crates/engine/src/tests/script_variables.rs`.
|
||||
- Scripts: `app.selectTool(name)` makes the named tool the current tool when the run ends without an error (https://community.adobe.com/questions-652/what-s-new-in-illustrator-scripting-cc2020-769942). `crates/engine/src/tests/script_dom.rs`.
|
||||
|
||||
Reference in new issue
Block a user