Commit Graph
9372 Commits
Author SHA1 Message Date
dotCooCoo 112eacbb1c Scripts: remove() keeps an emptied compound path, and note takes numbers
- remove() on the last path of a compound path keeps the compound path,
  empty, as move() does, so a script that holds it can still read it.
  edit.clear takes keepEmpty: true for this, and passes it on to
  path.deleteAnchors when it deletes direct-selected anchors; without
  it, Clear still deletes a compound path it empties.
- note, like name, takes a number or a Boolean as the text String()
  gives it.
- Assigning a graph mark or label the opacity it already has throws
  Cannot edit in a hidden or locked layer when the graph keeps another
  opacity for its series or kind, since the assignment would still
  change the graph.
- Only the exact opacity the getter reports counts as the opacity an
  object already has; a value that differs from it by less than 0.0001
  is now applied instead of being dropped.
- Reading a document's selection orders only the selected objects, by
  their place in the tree, so its cost no longer grows with the size of
  the document.
- docs/mcp.md: the opacity exception, note, keepEmpty, and that
  strict-mode code throws a TypeError when it assigns a member an object
  lacks.

Docs: docs/mcp.md.
2026-11-24 16:15:51 -08:00
dotCooCoo fe0e408607 Scripts: zOrder refuses art in a hidden or locked layer, and the same opacity may be assigned
- zOrder() on an object in a hidden or locked layer throws Cannot edit
  and changes nothing, as the other setters do.
- Assigning an object the opacity it already has no longer throws when
  its layer is hidden or locked. hidden and locked are still refused
  there, whatever the value.
- The docs say that a top-level var selection = ... assigns the
  selection, that the selection order and the tab order of documents
  differ from the objectReferences page, and that assigning a member a
  collection lacks throws Not found.

Docs: docs/mcp.md.
2026-11-24 16:15:50 -08:00
dotCooCoo 6b778a4c70 Scripts: setters refuse art in a hidden or locked layer, and empty objects read zero bounds
- Assigning hidden, locked, position, left, top, width or height to an
  object in a hidden or locked layer throws Cannot edit, as opacity
  does, and changes nothing. Its name and note still change.
- An object with nothing in it, such as an empty group or a compound
  path whose paths moved out, reads its bounds, position, width and
  height as zeros, and assigning them does nothing, so reading every
  property for-in lists does not throw on it.
- Assigning selection without app. sets the active document's
  selection, and app.selection can be assigned the same way. Assigning
  activeDocument without app. activates a document, and assigning
  documents keeps its value.
- JSON.stringify writes a collection, or data that holds one, without
  reading toJSON through the collection's name lookup, which threw
  Not found.
- The docs state that Object.keys, Object.getOwnPropertyNames and
  Object.getOwnPropertyDescriptor do not report the members, that a
  value assigned to a member the class lacks is not kept, and that the
  selection order is VectorCraft's own rule.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-23 13:24:33 -08:00
dotCooCoo 9872e6b679 Scripts: page items report their own members, and lists start with the topmost object
Scripts that check a member with hasOwnProperty before using it skipped
every page item, because the members live on the class prototype. Now
hasOwnProperty and propertyIsEnumerable are true for each member of an
object's class that is available, and for-in lists its properties but
not its methods. Members that only throw "not available yet" stay false.

- An empty selection is an empty list instead of null.
- pageItems lists art topmost first, as the CMYKColor example reads the
  frontmost path as pathItems[0]
  (https://ai-scripting.docsforadobe.dev/jsobjref/CMYKColor/). A
  document's selection lists the selected objects in that order too,
  whatever order they were picked in. That selection order is
  VectorCraft's own rule.
- A collection read with a name, such as pageItems["Logo"], gives what
  getByName gives, as
  https://ai-scripting.docsforadobe.dev/scriptingJavascript/objectReferences/
  shows. A name nothing has throws Not found, and assigning to such a
  name throws the same error.
- activeDocument, documents and selection can be named without app., as
  that page describes for the application's members.
- move() with the object itself and PLACEBEFORE or PLACEAFTER leaves it
  where it is and adds no undo step.
- move() keeps a compound path whose last path moves out, so a script
  that holds it can still read it.
- Assigning opacity to an object in a hidden or locked layer throws
  Cannot edit and changes nothing.
- name takes a number or a Boolean as its text.
- String() of an object gives its class and name, such as
  [PathItem Logo].

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-23 13:24:32 -08:00
dotCooCoo dc9adb195d Scripts: pageItems lists the art inside blends, envelopes, repeats and intertwines
pageItems walked into groups and compound paths only, so the objects inside a blend,
an envelope, a repeat or an intertwine were missing from length, [i], index and
getByName, although each of them reports that container as its parent. The walk now
goes into every container's children.
2026-11-22 15:33:08 -08:00
dotCooCoo 3d460c1697 Scripts: guide, layer, move and addDocument fixes for the object model
- Document.selection and PageItem.selected refuse a path made into a
  guide while Lock Guides is on, instead of passing the check and then
  selecting nothing. The locked artboards are measured once per
  assignment.
- An edit whose command selects the objects it changes puts the current
  layer and the highlighted Layers panel rows back as they were.
  layer.setCurrent takes keepRows, which leaves the highlighted rows as
  they are.
- move on an object on a locked artboard throws Cannot move, as editable
  reads false for it. duplicate, with or without a relative object, on a
  hidden or locked object or an object on a locked artboard throws
  Cannot duplicate and makes no copy.
- When move takes the last path out of a compound path, the empty
  compound path is deleted in the same undo step.
- addDocument writes each warning from reading the profile's file to the
  Script Console as addDocument: <warning>, and a previewMode of
  PixelPreview throws an error that says it is not available yet.
2026-11-22 15:33:08 -08:00
dotCooCoo 341f764458 Scripts: editable is false on a locked artboard, page item lists kept for several documents
- PageItem.editable is false for art on a locked artboard, as remove()
  refuses it. A group on a locked artboard is measured once for all its
  members.
- The lists of page items are kept for the last four documents read, so
  a script that reads two documents in turn does not walk each one again
  on every index.
2026-11-22 03:26:18 -08:00
dotCooCoo 67633efb4d Scripts: a linked profile file is refused and preset values count as passed data
A New Document profile file that is a link or a folder is no longer read:
the read is exempt from a script's file gate, which never checked where a
link leads. file.new reports it as a profileError with the reason "not a
plain file".

Reading a DocumentPreset setting now counts the value it returns toward
the data a run may pass, as assigning it does, and addDocument counts the
preset's settings before copying them.

The removeAll() test on a locked artboard now also holds an object on an
unlocked artboard and checks it is still there after the call throws.
2026-11-21 21:36:54 -08:00
dotCooCoo abe8b303de Scripts: remove and removeAll keep art on a locked artboard
PageItem.remove() and PageItems.removeAll() checked only whether the
object and its layers and groups were shown and unlocked, then passed the
ids to edit.clear, which deletes named objects without checking artboard
locks. Both now throw "cannot delete objects on a locked artboard" with
the object ids and delete nothing, as art on a locked artboard is not
editable elsewhere in the document.
2026-11-21 18:14:01 -08:00
dotCooCoo 5cb6480258 Scripts: assigning PageItem.selected keeps how the other objects are selected
Setting selected to true or false runs select.add or select.toggle for that one object, so the
other objects keep their direct-selected anchors and segments and the key object. Before, it
replaced the selection with whole objects.
2026-11-21 14:53:28 -08:00
dotCooCoo ba0441c458 Scripts: addDocument takes only a DocumentPreset and throws when its profile cannot be read
- new DocumentPreset() now makes an object of the DocumentPreset class whose settings the run
  keeps, so addDocument refuses a plain object, one with a typename of DocumentPreset included,
  with a TypeError naming presetSettings.
- When file.new reports a profileError, addDocument throws an error that names the profile and
  the reason, and the document made with the defaults is put back.
- A script's file.new reads the New Document profile file in the app's own profiles folder;
  the automation roots in force still apply. Before, the script's file gate refused the folder,
  so a scripted addDocument never used an edited profile.

Docs: docs/mcp.md.
2026-11-21 14:33:43 -08:00
dotCooCoo f33e0cb16d Scripts: PageItem.remove refuses hidden or locked art as removeAll does
remove() on an object that is hidden or locked, sits in a hidden or locked layer or group, or is a group holding such an object now throws and deletes nothing, the same rule pageItems.removeAll() applies. docs/mcp.md states both rules and that width and height scale along the page's axes.
2026-11-21 12:37:34 -08:00
dotCooCoo 626d843520 Scripts: list the object model in the host name check, refuse zOrder inside a compound path
The host name test now has rows for app, the document model classes and the enumerations the script host adds. zOrder on a path inside a compound path throws an error and leaves the document unchanged, as duplicate does.
2026-11-21 10:34:09 -08:00
dotCooCoo 6cce980e2b Scripts: keep targets and chosen parts when edits restore the selection
- An edit a script makes puts back a Layers panel target, an object
  chosen inside a dynamic symbol instance and an object chosen in an
  Objects on Path group, each with its own selection command.
- Assigning a document's selection selects a symbol instance or an
  Objects on Path group as a whole when one of its objects was chosen.
- file.newPresets lists a grid by column's rows as set, also when there
  are fewer artboards than rows, and New Document's Columns shows the
  columns those rows give the current number of artboards.
- docs/roadmap.md's M13 row names the script object model that is
  available.
2026-11-21 09:46:14 -08:00
dotCooCoo f70d2ee7e6 Scripts: duplicate, selection and wrapper fixes for the object model
- duplicate() runs Edit > Duplicate, the place and the selection
  restore under one savepoint, so a refused place leaves the documents,
  the selection and the undo history as they were. It reads the copy's
  id from the command's own result, so ids above 2^53 return the copy.
  A path inside a compound path throws an error instead of copying the
  whole compound path.
- An edit restores a mixed selection (direct-selected anchors and whole
  objects) in its original order with one select.anchorsMany.
- Assigning the selection clears a Layers panel target.
- A call on an inactive document switches back even when the selection
  restore fails.
- documents.add with a grid by column passes the row count to file.new,
  which takes a new artboardLayout.rows key: 5 artboards in 4 rows give
  columns of 4 and 1. A preset keeps the rows until columns without
  rows, or another layout, is given, and New Document drops them when
  Columns or the layout changes.
- A held page item stays the same object when its class changes in the
  same family (a placed image that is embedded becomes a RasterItem).
- A waiting class member's answer is read as a class instance, and a
  class constructor called with new cannot wait.

Docs: docs/mcp.md (DocumentPreset, duplicate, file.new rows), docs/gaps.md
(G6).
2026-11-21 08:43:10 -08:00
dotCooCoo f2d3b09fe6 Scripts: app, documents, selection and page items for scripts
Scripts get an app object with its documents, the active document and its
selection, and the page items of a document, read and edited through
commands so each edit is one undo step and is journaled. Host classes in
the JavaScript engine give each document or item one object while a script
holds it, answer `in` and indexed reads, and throw on stale objects and on
members that are not available yet.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-21 05:13:46 -08:00
BFlat f593dff00c Merge pull request #8903 from dotCooCoo/fix/plugins-folder-special-files
Plug-ins: the plug-ins folder can't block startup on a special file
2026-11-21 11:02:50 +07:00
BFlat 4ce43b1091 Merge pull request #8532 from dotCooCoo/feat/distorted-image-commands
Links: Relink, Embed and Unembed keep a distorted image's corners
2026-11-21 11:01:53 +07:00
BFlat ddcefb86c9 Merge pull request #8918 from storytold/train/carry8875
Path Precision Tools: the Tangent Circle Tool leaves out a circle that would reach past the canvas (#8875)
2026-11-21 11:00:19 +07:00
BFlat 1a1a939bdf Merge pull request #8858 from dotCooCoo/fix/style-redefine-series-own-links
Graphic Styles: Redefine Graphic Style keeps the own style of a path inside a series group linked to the target
2026-11-21 10:56:45 +07:00
BFlat 9078e13d78 Merge pull request #8867 from dotCooCoo/perf/selection-widgets-kind-first
Selection: on-canvas widgets check an object's kind before its editability
2026-11-21 10:56:16 +07:00
bflatastic 3bda231dd6 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/target-app-parity.md
2026-11-21 10:46:25 +07:00
BFlat 96726b1f41 Merge pull request #8837 from dotCooCoo/fix/live-paint-contents-group-targets
Live Paint: graphic styles on a group's contents give fills to its faces and strokes to its edges
2026-11-21 10:39:37 +07:00
BFlat f558297963 Merge pull request #8681 from dotCooCoo/feat/retype-near-matches
Retype: near matches within a tolerance, and words outlined as one compound path
2026-11-21 10:38:18 +07:00
BFlat 911177c775 Merge pull request #8874 from dotCooCoo/docs/3d-shadow-expands-blurred-as-image
Docs: a blurred 3D shadow expands to an image
2026-11-21 10:37:51 +07:00
BFlat 53fe391488 Merge pull request #8865 from dotCooCoo/fix/palette-typo-order-docs
Command Palette: docs order typo matches by the field the word is met in
2026-11-21 10:37:26 +07:00
BFlat 193f110ebe Merge pull request #8864 from dotCooCoo/fix/relink-edited-mask-docs
Docs: Relink and Update Links keep a clipping mask edited in the document
2026-11-21 10:37:02 +07:00
BFlat 6aaef5ad68 Merge pull request #8886 from dotCooCoo/fix/outline-compound-strokes-not-fill
Pathfinder: Outline of a compound shape with no fill adds no stroke of its own
2026-11-21 10:35:55 +07:00
BFlat 7945ef5c86 Merge pull request #8884 from dotCooCoo/fix/safe-mode-expand-symbol-art
Expand Appearance: Safe Mode checks symbol art that a group's raster effect draws
2026-11-21 10:35:31 +07:00
BFlat f39e3e06cf Merge pull request #8871 from dotCooCoo/feat/draw-behind-place-symbol
Symbols: in Draw Behind a placed instance goes directly below the selection
2026-11-21 10:35:08 +07:00
BFlat e8b23c5ba9 Merge pull request #8852 from dotCooCoo/fix/mesh-picks-survive-tool-switch
Mesh: picked points stay picked between the mesh-point tools
2026-11-21 10:33:52 +07:00
BFlat a5f9966ca5 Merge pull request #8861 from dotCooCoo/feat/freeform-lines-leave-ends-line
Gradient: moving out of a freeform object ends the Lines mode line
2026-11-21 10:33:27 +07:00
BFlat 4c0edd8844 Merge pull request #8904 from dotCooCoo/feat/script-check-host-classes
Script checker: setting a File's length, hidden or readonly counts as a file write
2026-11-21 10:32:19 +07:00
BFlat 3f5531a7d3 Merge pull request #8881 from dotCooCoo/fix/dimension-first-pick-link
Dimension: a first Linear point keeps its link when the art moves before the second click
2026-11-21 10:18:42 +07:00
dotCooCoo ce2fd22267 Path Precision Tools: the Tangent Circle Tool works out its circle again after a canceled live edit
A live edit changes the document without an undo step, so the tool was
not told about it. Circles found while a preview moved the second
segment stayed cached under the same segment key, and a click after the
preview was canceled drew the cached circle instead of one touching the
segment where it is again. A first segment picked during a preview kept
its old shape the same way.

The cache key now holds the shapes of the first segment and of the
segments a circle may touch, so moving along an unchanged segment still
reuses the search. The first segment is forgotten when its shape no
longer matches the document, and a press on the second segment follows
the segments as they are at the release; a pressed segment that is gone
leaves nothing to touch.
2026-11-20 19:15:06 -08:00
dotCooCoo b2e7784160 Docs: progress line for the script checker's File setters and host test
docs/target-app-parity.md gets a line for the file.write report on a
File object's length, hidden and readonly and for the test that lists
every name the script host adds, with the tests that cover them. The
test's comment on vc no longer names another app.
2026-11-20 19:05:54 -08:00
dotCooCoo e2d62de4fe Merge main into feat/distorted-image-commands 2026-11-20 18:54:01 -08:00
dotCooCoo 417ed94431 Script checker: setting a File's length, hidden or readonly counts as a file write
Setting a File object's length truncates or pads the file, and setting
readonly or hidden changes it, but script.check reported no outside
category for those assignments. It now reports file.write and
filesWritten for them: plain and compound assignment, ++ and -- before
or after, and the property name as a string literal in brackets.

A new integration test lists every global and member the script host
adds to the JavaScript engine (the own properties of the global object,
of each object or function it holds and of each function's prototype,
compared with a plain engine) and fails when one has no row. Each name
that reaches outside the document has a probe script, and the test
checks that script.check gives it the expected outside id. vc is listed
as not checked: script.check reads scripts written for the reference
app's scripting, and what vc.run does depends on the command. The test
also checks that the checker lists every preprocessor directive the
host reads, through the new DirectiveName::ALL.

File object properties:
https://extendscript.docsforadobe.dev/file-system-access/file-object/
2026-11-20 18:36:13 -08:00
BFlat 80c9dadf59 Merge pull request #8893 from dotCooCoo/fix/blends-live-in-file-formats-gap 2026-11-21 09:08:15 +07:00
BFlat e33f3d3f7c Merge pull request #8901 from dotCooCoo/feat/plugin-wasm-features 2026-11-21 09:07:52 +07:00
BFlat 4596183e67 Merge pull request #8898 from dotCooCoo/feat/scripts-api-c1-corpus 2026-11-21 09:01:03 +07:00
BFlat f35cf264c1 Merge pull request #8899 from dotCooCoo/docs/ai-deep-distorted-images 2026-11-21 08:51:00 +07:00
dotCooCoo 2adc433f5e Plug-ins: the plug-ins folder can't block startup on a special file
A folder load checked each .wasm path and then opened it with a blocking
open. When a named pipe replaced the file between the two, the open held
the load until something wrote to the pipe, and with it startup or a
prefs.set of the folder. On Unix the file is now opened
without waiting and without making a terminal the controlling terminal,
and the opened file is checked again: anything that is not a regular file,
or is over the module limit, is refused and listed in the folder report.

A folder load still reads at most 1,000 .wasm files, the first by file
name, and now holds only those paths while it lists the folder. The
files past the first 1,000 were dropped and not reported; plugin.reload
and plugin.list now return their count as leftOut. An error while the
folder is listed fails the load, as an error opening the folder does,
instead of dropping the entries after it.
2026-11-20 17:28:22 -08:00
Dylan M. TayloranddotCooCoo 82d5aabeec refactor(cdr): use shared craft-cdr from craft-libs (#8857)
* refactor(cdr): depend on shared craft-cdr from craft-libs (#1665)

Replaces the local crates/cdr (vectorcraft-cdr) crate with craft-cdr
from storytold/craft-libs#2697 (storytold/craft-libs#778), keeping
VectorCraft's document/artboard/layer/shape mapping in crates/engine.

Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>

* build(cdr): pin craft-cdr to craft-libs main (75d179f8df)

* build(cdr): pin craft-cdr to craft-libs main (9b28b56bc7)

* docs(cdr): point CDR/CMX provenance and test paths to craft-cdr

---------

Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>
2026-11-20 20:27:55 -05:00
dotCooCoo 0d1009fab0 Dimension: a first Linear point goes back to its pick when its art is deleted
The first point followed its moved art by overwriting the stored point, so
when that art was then deleted the point stayed at the moved position
instead of where it was picked. The tool now keeps the pick separately and
falls back to it for the marker, the rubber band, Shift and the dimension.
A first anchor whose path is deleted is dropped from the point, so the
second click still places the dimension.
2026-11-20 17:25:58 -08:00
dotCooCoo b0fba57f4a Plug-ins: the host checks the WebAssembly features a plug-in uses
Plugin::load now validates each module with wasmparser and a fixed list
of WebAssembly features before wasmi reads it: mutable globals, sign
extension, saturating conversions, multi-value, bulk memory, reference
types, tail calls, extended constant expressions and floats. A module
that uses any other feature is refused, so a wasmi upgrade, a change to
its defaults or one of its crate features turned on elsewhere in the
build does not change what a plug-in may use. wasmi's Config is set to
the same list for every setter it has in this build.

The list is the set wasmi accepted before, without multi-memory. A
second memory was already refused by the one-memory limit; its error
now says "multiple memories". No module that loaded before is refused.

wasmparser 0.228.0 is the version wasmi 2.0.0 already uses.

A new test loads a plug-in that uses each listed feature and checks
that modules using SIMD, relaxed SIMD, memory64, a second memory,
custom page sizes, wide arithmetic, threads, exceptions, legacy
exceptions, function references or garbage collection are refused with
an error that names the feature.

docs/plugins.md lists the whole set; it named only four of the allowed
features before.
2026-11-20 17:25:01 -08:00
dotCooCoo bb8d24017a Docs: .ai writers write a distorted image 8 deep as its nearest placement and leave out deeper ones
The mesh sentence in docs/mcp.md no longer lists the .ai writers among
the exports that draw a mesh. Both docs now say the fallback applies to
an image nested 8 deep, name the containers each writer counts (ordinary
groups and layers do not count), and say an image nested deeper is not
written. The Perspective Distort line cites the two nesting tests.
2026-11-20 17:24:20 -08:00
dotCooCoo 5511fb21c0 Docs: distorted images nested past the .ai writers' depth limit are written at their nearest placement
The mesh paragraph in docs/mcp.md named DXF, WMF and HP-GL as the only
exports that do not draw a distorted image as a mesh. The editing data
of a .ai file writes an image inside 8 or more nested opacity masks,
symbols, live objects and pattern tiles as the parallelogram nearest its
corners, and a legacy .ai (version 7) does so inside 8 or more nested
symbols and live objects, each with a warning. The paragraph and the
Perspective Distort line in docs/target-app-parity.md now say so.
2026-11-20 17:11:16 -08:00
dotCooCoo bbc183f793 Tests: fetch a pinned public script corpus and report its headless pass rate
Part of #1210.

- `cargo xtask corpus --scripts` fetches 397 scripts and 1 included file
  from 19 MIT and Apache-2.0 repositories at pinned commits into
  corpus/scripts, each repository's license file beside its scripts.
  xtask/script-corpus.txt lists every file with its size and SHA-256; a
  download replaces the previous copy only when both match. One more
  candidate is listed as excluded because it is over the 1 MiB limit for
  one script. The fetch caps 64 MiB of scripts and 128 MiB of transfer,
  refuses `..`, absolute paths, reserved names, case-fold collisions and
  links, and holds a lock file while it runs.
- `cargo xtask corpus` takes at most one of --download, --affinity and
  --scripts, and refuses other arguments with the usage text.
- `cargo xtask scripts --pass-rate [--report <path>]` runs each script in
  a process of its own (the ignored `row` test in
  crates/engine/tests/script_corpus.rs): a new document, 5,000,000
  instructions, no dialog answers, file reads only in the script's
  repository folder and a new folder of its own, file writes only in that
  folder, stopped after 10 seconds. It writes a JSON report with the pass
  rate overall, per repository and for scripts without dialogs or
  windows, how many parse, and each script's outcome, with local folders
  removed from messages. Script failures never fail the command, and
  without the corpus it prints a skip line and exits 0.
2026-11-20 16:47:30 -08:00
dotCooCoo b501ea0222 Docs: the File formats rows leave out blends a saved .ai keeps live
Since #8289 a saved .ai's editing copy keeps live the blends the .ai
reader opens with their settings and as they are drawn. The three File
formats rows in docs/target-app-parity.md still listed every live
object other than four graph types as read back as art. They now name
those blends as kept live too. Blends written as their steps stay in
the gap, and file-format-parity.md lists them.
2026-11-20 16:44:28 -08:00