Commit Graph
19434 Commits
Author SHA1 Message Date
dotCooCoo fbc057f8b0 Scripts: points of a path in a selected group read as selected
PathPoint.selected and PathItem.selectedPathPoints now count a path as
selected as a whole when a group or compound path that holds it is
selected, as the canvas shows its anchors. Assigning
PathPointSelection.NOSELECTION to a point of such a path throws an
error that says it is not available yet, and ANCHORPOINT on it runs no
command, so the selection is not left holding both the group and one
of its paths.

Selecting a point of a guide while guides are locked throws an error
instead of running a selection that the guide lock undoes.

Assigning guides = false on a path that cannot be selected (outside
the isolated object) throws Cannot edit, as guides = true does.

Reading PathPoint.selected no longer writes the point changes waiting
for its path unless they add or remove points, so a loop that reads
selected and moves the selected anchors writes the path once.
2026-11-23 13:14:01 -08:00
dotCooCoo dd74879624 Scripts: guides refuse compound members and locked guides in both directions
Assigning PathItem.guides on a path inside a compound path made every
path in that compound a guide, because Make Guides acts on the compound
that holds a selected member; it now throws an error that says it is not
available yet, as duplicate and zOrder do for compound members. While
guides are locked, assigning false threw and assigning true succeeded;
now either value throws when it would change the path. A path that
cannot be selected, for example one outside the isolated group or on a
locked artboard, throws Cannot edit before any command runs. Assigning
the value a path already has runs no command and throws no error. These
are VectorCraft's own rules, and docs/mcp.md lists them with the other
rules of its own.

Tests cover a compound path member, a clipping path, a locked and a
hidden path, the guide lock in both directions, a path in a group of
two, and the TypeError name for a value that is not a boolean.
2026-11-23 13:14:01 -08:00
dotCooCoo 262090d75a Scripts: path points read and set their selection, and guides can be assigned
PathPoint.selected and PathItem.selectedPathPoints threw an error that
said they were not available yet, and PathItem.guides could only be
read. selected now reads PathPointSelection.ANCHORPOINT for a selected
anchor point and NOSELECTION otherwise, and assigning either adds or
removes the point with select.anchorsMany, keeping the other selected
objects and anchors. Every point of a path selected as a whole counts
as selected. Direction handles cannot be selected on their own, so the
handle values throw an error. selectedPathPoints lists the selected
points in pathPoints order. Assigning guides makes the path a guide or
a path again with view.guides.make or view.guides.release, keeping the
selection; a value that is not a boolean throws a TypeError, and a
clipping path cannot be made a guide. A value the point or path already
has runs no command.

https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/
https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/
2026-11-23 11:06:19 -08:00
dotCooCoo fbda312b17 Merge feat/scripts-api-d1a-app-documents into feat/scripts-api-d2-paths-colors
# Conflicts:
#	crates/engine/src/script/dom.rs
#	crates/engine/tests/it/script_host_vs_scriptcheck.rs
2026-11-21 19:59:11 -08:00
dotCooCoo 71aaa752a0 New Document: a new layout keeps the columns a preset's rows showed
A preset made with file.new's rows under gridByColumn shows the column
count those rows give the current number of artboards. Changing the
Layout field removed the rows and kept the preset's stored columns, so
Create laid out a different number of columns than the dialog showed.
The layout change now writes the shown count into columns, for rows
stored as integers or floats. Under gridByRow the dialog shows the
stored columns and file.new rejects rows, so a layout change from it
keeps the stored columns, as it does for rows file.new would reject.
2026-11-21 19:52:56 -08:00
dotCooCoo 74fefce46f Scripts: assigning selected keeps other objects' direct-selected anchors
Setting a page item's `selected` rebuilt the selection with select.set,
which selects every object whole, so the direct-selected anchors and
segments of the other selected objects were lost. When another object
has some, the selection is now rebuilt the way an edit restores it,
with only the item added or removed.
2026-11-21 18:50:26 -08:00
dotCooCoo bb931b5df7 Scripts: file.new rejects rows that are not a whole number from 1 to 1000
artboardLayout.rows rounded a fractional count and lowered a count over
1000 to 1000, so file.new made a different grid from the one asked for.
It now throws for both, and docs/mcp.md states the range.
2026-11-21 18:32:23 -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 bd945697e8 Scripts: a path point read before a command changes its path is stale
A PathPoint read before vc.run('path.setAnchors', ...) replaced its
path's points stayed valid, so a later write changed the replacement's
point at the same index. The object model now keeps each path whose
points the script read and checks it after every command and when a
point is used. When the path's points differ from the ones it last saw,
or the path is gone, the points read before throw `Stale path point`.
This covers any command run with vc.run, an undo, and a change that a
later command reverses. Points stay valid through the object model's
own changes to the path or to an object that holds it, such as
translate().

docs/mcp.md and the module doc state the rule.
2026-11-21 18:06:28 -08:00
dotCooCoo e15e3e083d New Document: Columns reads float rows and columns as file.new does
The dialog read artboardLayout's rows and columns as whole numbers only,
so a value stored as a float (4.0 from ui.dialog.set) fell back to the
stored columns while file.new made the grid from it. The dialog now reads
both as file.new does: a number of 1 or more, rounded and kept to the
artboard limit.
2026-11-21 17:35:17 -08:00
dotCooCoo 07d673898f Scripts: a path point read before its path's points are removed is stale
A PathPoint kept its index, so after `remove()` of an earlier point it
read and changed the point that moved into its place. A point read
before the script removed a point of its path (`remove()`,
`removeAll()`) or replaced its points (`setEntirePath`) now throws
`Stale path point`.
2026-11-21 15:14:52 -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 1548547fc1 Scripts: ask before keeping a run whose last point changes pass the growth allowance
Point changes a script leaves waiting are written when its script ends.
When that write went past the growth allowance in a run that can ask,
the run was kept at once without asking. The run now waits with its
script finished: Continue keeps it, and Stop puts every document back
as a stopped run does.
2026-11-21 14:42:22 -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 243e8ad251 Merge feat/scripts-api-d1a-app-documents into feat/scripts-api-d2-paths-colors 2026-11-21 13:41:52 -08:00
dotCooCoo 55f615d0c9 Scripts: write path point edits with one command, keep colors exact
- Changes to a path's points (closed, setEntirePath, pathPoints and each
  PathPoint) wait in the object model and are written by one
  path.setAnchors before any other member or command, before another
  path's points change, and when the script ends. A loop over 2,000
  points now runs one command and makes one undo step. A path aligned to
  the pixel grid is written at each change so its points read snapped.
- A color component reads with the fewest decimals, at least 4, that give
  the stored value back, so assigning a color read from a path leaves the
  path unchanged (RGB, CMYK, Gray and Lab, fill and stroke).
- add() and the shape creators put the new path on top of the active
  layer whatever the drawing mode, and leave the mode as it was.
- fillOverprint and strokeOverprint change the top fill or stroke only.
- filled = true on a compound path member places the new-art gradient on
  the compound path's bounds.
- An identity rotate or resize checks its arguments and runs no command,
  on an empty path too.
- Tests for each of these, and for setAnchors reading smooth false as a
  corner.

Docs: docs/mcp.md, docs/gaps.md, docs/roadmap.md,
docs/target-app-parity.md.
2026-11-21 13:32:25 -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 76aee609f1 Tests: page item width and height setters give the page-aligned size on rotated objects
A rotated rectangle given a width and then a height through the scripting object model reads back the values set, its geometric bounds have that size, and other objects stay as they were. The resize doc comment names the page's axes.
2026-11-21 12:21:32 -08:00
dotCooCoo a8d1b29766 Tests: the script corpus failure test reads an undefined name
Scripts now have an app object, so app.activeDocument no longer throws a
ReferenceError. The test reads a name the host does not define instead.
2026-11-21 11:46:08 -08:00
dotCooCoo 4bc1f7a187 Scripts: Documents.add takes the artboard spacing file.new takes
artboardSpacing is refused above 100,000 points, the limit file.new
applies, so a value file.new would refuse throws a RangeError that names
artboardSpacing.
2026-11-21 11:40:55 -08:00
dotCooCoo 4b97cc8492 Scripts: a failed selection restore ends the run unless the command refused
When an edit puts the selection back, the Layers panel target, symbol part,
Objects on Path member, ruler guide and key object commands fall back or
skip only when the command refuses with an ordinary error. An internal
failure or a request to stop now ends the run instead of being treated as
a refusal.
2026-11-21 11:18:44 -08:00
dotCooCoo 43813db855 Scripts: paths, path points and colors for scripts
Document.pathItems lists a document's paths and makes empty paths,
rectangles, rounded rectangles, ellipses, polygons and stars with the
parameter order and defaults of the PathItems help page. A PathItem
reads and changes its points, closed state, fill rule, area, length,
fill and stroke colors, stroke options and overprint, and translates,
rotates and resizes. PathPoints and PathPoint read and set each
point's anchor, handles and type. RGBColor, CMYKColor, GrayColor,
LabColor and NoColor make colors; a gradient, spot or pattern paint
reads as GradientColor, SpotColor or PatternColor.

Each change runs an existing command (path.create, the shape.*
commands, path.setAnchors, path.close, path.setFillRule,
paint.setFill, paint.setStroke, stroke.set, object.setOverprint,
object.move, object.rotate, object.scale) inside the run's one undo
step, and puts back the selection and the paint for new art. A value
that changes nothing runs no command; a bad value throws and changes
nothing.

path.setAnchors now makes an anchor a corner when it is given
`smooth: false`; before, the key was ignored and handles in line made
it smooth.
2026-11-21 11:03:42 -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 9fff48d88f Merge pull request #8910 from dotCooCoo/fix/similar-fonts-thai-scan
Type: the font scan tells whether a family sets Thai as loading it does
2026-11-21 11:03:21 +07: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 93388d642f Merge pull request #8887 from dotCooCoo/fix/tangent-circle-close-contacts
Path Precision Tools: the Tangent Circle Tool finds both circles where two second segments touch close together
2026-11-21 11:02:18 +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 5b52369187 Merge pull request #8919 from storytold/train/carry8873
Dimension: pointer moves read a compound path's members once per revision (#8873)
2026-11-21 10:58:44 +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
bflatastic 8daaa2995b Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/tools/src/dimension.rs
2026-11-21 10:43:59 +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 d77b6d9309 Merge pull request #8870 from dotCooCoo/fix/dimension-guide-member-holder
Dimension: a guide member of a compound path does not hold a preview-bounds corner
2026-11-21 10:39:09 +07:00
BFlat 54f256f666 Merge pull request #8634 from dotCooCoo/fix/select-widget-drags-settle
Selection: widget drags read the release point and a tool switch cancels them
2026-11-21 10:38:43 +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 de11798f93 Merge pull request #8892 from dotCooCoo/fix/kinsoku-paste-relayout-test
Kinsoku sets: tests for pasted type and shaped lines under a custom set
2026-11-21 10:36:41 +07:00
BFlat 43e0407cd0 Merge pull request #8891 from dotCooCoo/fix/eraser-drag-midpoint-tip
Eraser: a drag's outline takes the tip halfway along each step in two more cases
2026-11-21 10:36:19 +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 ada693c03c Merge pull request #8868 from dotCooCoo/perf/legacy-ai-gradient-index
Legacy .ai: gradient definitions are found by a key of their gradient
2026-11-21 10:34:44 +07:00
BFlat c86bb07a44 Merge pull request #8854 from dotCooCoo/fix/confined-single-pdf-test-artboards
Tests: a confined single-file PDF of several artboards checks every artboard it carries
2026-11-21 10:34:16 +07:00