Commit Graph
544 Commits
Author SHA1 Message Date
dotCooCoo ab35e04329 Merge main into feat/scripts-api-d1b-prefs-matrix-clipboard 2026-12-02 15:23:31 -08:00
dotCooCoo f3c5127a4b Merge main into feat/scripts-api-d1b-prefs-matrix-clipboard 2026-12-02 13:59:55 -08:00
dotCooCoo d583b8053f Merge main into feat/scripts-pageitem-transforms 2026-12-02 13:09:44 -08:00
.CooCoo aeddf2f03a Merge pull request #9077 from dotCooCoo/feat/scripts-api-d8b-tracing
Scripts: PlacedItem.trace and RasterItem.trace make an Image Trace object with its tracing options
2026-12-02 12:37:15 -08:00
dotCooCoo 930c02ce8f Merge main into feat/scripts-pageitem-transforms 2026-12-02 12:20:10 -08:00
dotCooCoo f655aed4bb Merge main into feat/scripts-api-d1b-prefs-matrix-clipboard 2026-12-02 11:50:11 -08:00
.CooCoo d0d73ff553 Merge pull request #9131 from dotCooCoo/feat/js-es2017-async-await
JavaScript: .js scripts run async functions and await
2026-12-02 11:37:17 -08:00
dotCooCoo 497e2eb4e7 Merge main into feat/scripts-api-d8b-tracing 2026-12-02 11:33:20 -08:00
.CooCoo 5cfc4cf100 Merge pull request #9041 from dotCooCoo/feat/scripts-api-d2-paths-colors
Scripts: documents give scripts their paths, path points and colors
2026-12-02 11:15:31 -08:00
.CooCoo dcb7085b2a Merge pull request #9139 from dotCooCoo/feat/plugin-api-events
Plug-ins: react to selection, layer, open and save events
2026-12-02 11:15:23 -08:00
.CooCoo 5d22b25bb7 Merge pull request #10333 from dotCooCoo/fix/script-new-document-overprint-links
Scripts: file.new takes Overprint Preview and reads the profile's linked files
2026-12-02 11:15:14 -08:00
.CooCoo 0a14ee1d23 Merge pull request #10363 from dotCooCoo/fix/close-native-range
Scripts: close with SaveOptions.SAVECHANGES saves a native file whose last save named a range
2026-12-02 11:15:06 -08:00
.CooCoo 9fe1d7ecfb Merge pull request #10586 from dotCooCoo/fix/script-back-document-bounds
Scripts: geometry read from a document in the back matches what the setters measure
2026-12-02 11:14:48 -08:00
dotCooCoo eb5e4c5eb7 Scripts: retrace and release refuse a tracing with locked traced artwork
Retracing and releasing a tracing discard the objects its trace made, so
both now throw "Cannot edit page item <id>" when one of them is locked,
with nothing changed. Added artwork is still reported first. The scan
stops at the first added object and charges the objects it looked at to
the run on both the success and refusal paths.
2026-12-02 08:32:22 -08:00
dotCooCoo f8eb542e04 Scripts: geometry read from a document in the back matches what the setters measure
The bounds getters (position, left, top, width, height and the bounds
arrays) read an item in a document in the back without measuring its type,
while the setters measure it after the switch to that document since
#10538. A script that read t.width and assigned it back could resize the
item, and every geometry assignment switched to the document and back even
when nothing changed.

The getters now measure type not measured yet in a document in the back
for an item that holds type, a symbol instance or a placed document, the
way the switch measures it, and the check is skipped while the document is
unchanged. An assignment equal to the current value of an object without
such content in a document in the back returns without switching
documents, and no undo step is made.
2026-12-02 07:21:25 -08:00
dotCooCoo 549a383942 Merge main into feat/scripts-api-d2-paths-colors 2026-12-02 05:32:57 -08:00
dotCooCoo c2a2f38a4e Merge main into feat/js-es2017-async-await 2026-12-02 05:32:01 -08:00
dotCooCoo e61533b320 Merge main into feat/scripts-pageitem-transforms 2026-12-02 05:28:03 -08:00
dotCooCoo 2f51d8d1fe Merge main into feat/scripts-api-d1b-prefs-matrix-clipboard 2026-12-02 05:26:10 -08:00
dotCooCoo d359bb7e1a Print: Document.print throws for CUSTOMPROFILE without a profile name
A script that set PrintColorManagementOptions.colorProfileMode to
CUSTOMPROFILE and assigned no name printed with the base settings'
profile, as though no custom profile had been asked for. The job now
throws before anything is written, as it does for an empty name.

Follows up on #9087.
2026-12-02 05:13:50 -08:00
dotCooCoo a3ae03ba8a Scripts: pass the image predicate to is_some_and directly
Clippy 1.100's redundant_closure lint rejects the closure
`|n| image(n)` in makes_tracing, which fails the clippy step of the
gate with -D warnings.
2026-12-02 05:11:54 -08:00
dotCooCoo 47a8bcde18 Merge main into feat/scripts-api-d8b-tracing 2026-12-02 02:46:39 -08:00
dotCooCoo 3ea259e6b9 Merge main into feat/scripts-api-d2-paths-colors 2026-12-02 02:20:34 -08:00
.CooCoo d753c48d2e Merge pull request #10483 from dotCooCoo/fix/windows-evalfile-uri
Scripts: $.evalFile reads the URI paths File.parent gives, on Windows too
2026-12-02 02:02:31 -08:00
.CooCoo e3e84bd4fb Merge pull request #10539 from dotCooCoo/fix/ai-save-options-compatibility-default
Scripts: new IllustratorSaveOptions reads compatibility as ILLUSTRATOR19
2026-12-02 02:01:50 -08:00
dotCooCoo a1b8b01383 Scripts: refuse moves that make a tracing, and a release that drops added art
- move, remove() and zOrder throw "Only Image Trace can make a tracing",
  with nothing changed, when they would leave an image at the bottom of
  an ordinary group named Image Trace: a path moved out of the group or
  to its top, Send to Back or Send Backward on the image, and Bring to
  Front or Bring Forward on the object below it.
- releaseTracing() throws "Cannot release a tracing containing added
  artwork", with nothing changed, when the tracing holds an object its
  trace did not make. imageTrace.release keeps only the source image, so
  the added object would be deleted.
- The TracingOptions members with no setting and TracingObject.areaCount
  are left out of hasOwnProperty and reflect. Reading them still throws.

Docs: docs/mcp.md.
2026-12-02 01:26:30 -08:00
dotCooCoo 61770864ec Scripts: an inverse below half the smallest number rounds once
app.invertMatrix divided the rounded numerator by the determinant and
rounded again, so an x-translation whose exact quotient is just past
half the smallest number (numerator 2^-1021 + 2^-1075, determinant
2^54) came back as 0 instead of Number.MIN_VALUE. When the rounded
quotient is below 2^-1023, the result is now found from the exact
numerator and determinant: the multiple of the smallest number whose
halfway points hold the exact quotient, ties to the even one. A
quotient exactly at the halfway point still rounds to 0.
2026-12-02 00:49:28 -08:00
dotCooCoo e5df2445e3 Scripts: new IllustratorSaveOptions reads compatibility as ILLUSTRATOR19
A new IllustratorSaveOptions left compatibility unset, so a script that
read it before setting it got undefined. It now starts at
Compatibility.ILLUSTRATOR19, the documented default, which saveAs already
accepts without changing what it writes.
2026-12-01 21:31:56 -08:00
dotCooCoo efdaa06fd2 Scripts: reflect reports matrix defaults; copy notes keep the recording limit
- app.reflect now reports the defaults of the matrix functions' number
  arguments: 0 for deltaX, deltaY and angle, and 100 for scaleX, in the
  get and concatenate variants. scaleY has no fixed default, since a
  left-out vertical scale is the horizontal one; its description says so.
- When a script's commands take a recording past its limit and the script
  also copied, the notes of the Copy's formats no longer replace the
  limit message in the status bar. The limit is named only once, so the
  message is kept while it shows. The same applies to a script run that
  automation takes to its end at once.
2026-12-01 21:10:26 -08:00
dotCooCoo 70d70ca909 Scripts: width, height and position setters measure after the document comes to the front
Setting width, height, left, top or position on an item in a document in
the back measured the item before its document was made active. Making a
document active measures its type again where it is not measured yet or
where a composite font of the same name changed, so the scale ratio or the
move distance applied to bounds that no longer held, and the item ended
at a different size or place than the one asked for.

The measurement now runs inside the edit, after the switch, through a new
edit_item_with that edit_item also uses.
2026-12-01 21:09:17 -08:00
dotCooCoo c012eb8ee9 Merge main into feat/scripts-pageitem-transforms 2026-12-01 15:00:42 -08:00
dotCooCoo 40b27cd756 Merge main into feat/scripts-api-d1b-prefs-matrix-clipboard 2026-12-01 14:07:47 -08:00
dotCooCoo a7129f3eed Merge main into feat/scripts-api-d8b-tracing 2026-12-01 14:07:15 -08:00
dotCooCoo 9bf07c220e Merge main into fix/script-new-document-overprint-links 2026-12-01 13:53:12 -08:00
dotCooCoo 483bf2363d Scripts: invertMatrix decides overflow from the exact quotient
The determinant and the translation numerators are rounded before the
division, so a value whose exact quotient is below the overflow midpoint
could round to infinity and throw a RangeError, and one at or past it could
come out finite. When the rounded quotient overflows or lies within eight
steps of Number.MAX_VALUE, the exact quotient is now compared with the
midpoint between Number.MAX_VALUE and 2^1024 from exact product parts. An
infinite rounded quotient below it is replaced by the number the exact
quotient rounds to.
2026-12-01 13:25:11 -08:00
.CooCoo a5a3e40c5e Merge pull request #9087 from dotCooCoo/feat/scripts-print-printer
Scripts: Document.print prints to an installed printer and app.printerList lists the printers
2026-12-01 13:11:17 -08:00
dotCooCoo d9d9354ec7 Scripts: moving an image cannot make a tracing; counts do only their work
- move() and duplicate() refuse to put an image at the bottom of an
  ordinary group named Image Trace, before the document changes, as
  renaming such a group already does. A tracing's source image moved
  out keeps its own error.
- pathCount and usedColorCount no longer walk the anchor points, and
  anchorCount charges each path inside a compound path it reads.
- The run keeps the reverse of its replacement map, so finding the
  first object of a chain no longer scans the whole map at each step.
- docs: the source image of a traced item is left out of pageItems,
  placedItems and rasterItems and is reached through
  PluginItem.tracing.sourceArt; docs/mcp.md lists the new error.
2026-12-01 13:09:41 -08:00
dotCooCoo f01f2ce6c0 Fix #10463: $.evalFile reads File URI paths
File.parent gives a folder in URI notation (/c/Users/..., with %20 for a
space). $.evalFile joined that text to the script's folder as written, so
on Windows $.evalFile(File($.fileName).parent + '/more.jsx') looked under
C:\c\Users\... and reported "include file not found".

When an absolute path starting with one / names no file the script may
read, $.evalFile now also tries it with its escapes decoded and, on
Windows, with /c/... as the drive C:. The path as written is still tried
first, and the scope check, the .. refusal and the file limits apply to
every form. Share and device paths are not converted, and #include lines
are read as before.
2026-12-01 09:30:34 -08:00
dotCooCoo 6de89eece9 Merge main into feat/scripts-api-d8b-tracing 2026-12-01 09:00:59 -08:00
dotCooCoo 5530339d99 Merge main into feat/scripts-pageitem-transforms 2026-12-01 09:00:46 -08:00
dotCooCoo 4bb499bb97 Merge main into feat/scripts-api-d1b-prefs-matrix-clipboard 2026-12-01 08:46:33 -08:00
dotCooCoo 08bc2d2009 Scripts: image lists propagate the page item list's run error
Cause: main's fe89d3f8 changed page_items to return a Result, since
building the list again now counts against the run's host-call allowance.
The image collections' list builder still used the old return type, so
vectorcraft-engine did not compile once main was merged in, and every
gate shard failed. The builder now passes the error on with `?`, as the
path and text lists do.
2026-12-01 02:37:29 -08:00
dotCooCoo 99bea87cff Merge main into feat/scripts-api-d8b-tracing 2026-12-01 02:16:37 -08:00
dotCooCoo bf56f4d062 Scripts: a group holding an image cannot take the tracing's name
PageItem.name now refuses "Image Trace" for an unclipped group whose
first object is an image and that is not already a tracing. That name
would make the group a tracing, and expanding it would delete its first
object.

The snapshot of a tracing's objects is now taken only for a tracing
saved without the record of the objects its trace made, and only the
first time a run sees it. Retrace reads it only in that case.

docs/target-app-parity.md now says that the view options only change
the view, and docs/mcp.md lists the new rename error.
2026-12-01 02:00:17 -08:00
dotCooCoo c4742a7c91 Merge main into feat/scripts-api-d1b-prefs-matrix-clipboard 2026-11-30 21:03:32 -08:00
dotCooCoo 21aeb77367 Merge main into feat/scripts-pageitem-transforms 2026-11-30 21:02:41 -08:00
dotCooCoo ea8352c5d7 Merge main into feat/scripts-print-printer 2026-11-30 20:57:56 -08:00
dotCooCoo 5134b5a7bc Merge main into fix/script-new-document-overprint-links 2026-11-30 20:54:11 -08:00
dotCooCoo 32543571f3 Scripts: close with SaveOptions.SAVECHANGES saves a native file whose last save named a range
A native save keeps every artboard in its main file and reads `range` only
for the separate files of `separateArtboards`. The close check treated a
native document last saved with `range` and without `separateArtboards` as
a save of some artboards, and refused to close it although the save writes
every artboard.
2026-11-30 20:41:27 -08:00
dotCooCoo 74e572c8c5 Merge main into fix/script-page-item-edits
# Conflicts:
#	crates/engine/src/script/dom/paths.rs
2026-11-30 19:56:24 -08:00