Commit Graph
19539 Commits
Author SHA1 Message Date
dotCooCoo 3ef4b97983 Scripts: closing with SAVECHANGES keeps the document's format, and an empty artboardRange is refused
Document.close(SaveOptions.SAVECHANGES) now saves in the format the document was last saved in, so a PDF saved to a file whose extension names another format stays a PDF. An artboardRange with no parts, such as ',' or ' , ', now throws, as a range used for the save does.
2026-11-24 21:58:26 -08:00
dotCooCoo e8a0aa6ba4 Scripts: documents give their file, folder and saved state, close, and save several artboards
- Document.fullName is a File for the document's file, and Document.path a
  Folder for its folder. A document without a file has a fullName of a
  File for its name in Folder.current and a path of "". Both throw
  `Script file access denied` with the document's name when the
  automation read roots do not allow the file.
- Document.saved reads whether the document has unsaved changes. Setting
  it runs the new command document.setSaved, which records the document
  as saved or as changed without saving it and adds no undo step.
- Document.close(saveOptions) closes a document without unsaved changes
  with any SaveOptions value. With unsaved changes,
  SaveOptions.DONOTSAVECHANGES closes it without them, and
  SaveOptions.SAVECHANGES saves them first with file.saveAs, in the
  format the file's extension names and after the write-access check
  saveAs makes, and throws for a document without a file (a converted
  or recovered one included). SaveOptions.PROMPTTOSAVECHANGES, the
  default, throws, since a script cannot show the prompt.
- The script checker reports SaveOptions.SAVECHANGES under filesWritten
  wherever the script reads it.
- A pDFPreset in square brackets, such as [Smallest File Size], names
  the built-in preset of the name inside them.
- artboardRange takes a whole number from 1 as well as a string; any
  other number throws.
- With saveMultipleArtboards true, a .ai or EPS save also writes each
  artboard of the range to a file of its own. Without it the range is
  not used, but text that is not a range of artboard numbers throws.

Document page: https://ai-scripting.docsforadobe.dev/jsobjref/Document/
2026-11-23 19:01:40 -08:00
dotCooCoo 9034e0d6d8 Scripts: a saveAs value that goes on after the function body writes a file
The script checker treats a saveAs or exportFile key of the script's own
object literal as the script's own method only when the key's whole value
is one function expression: `function`, an optional name, the parameters
and the body, followed by `,` or the literal's closing brace. A value that
goes on after the body, such as `function () {} && doc.saveAs`, a call of
the function or a conditional, leaves the method reported as a file write.

The variable takes the literal's methods before the token after the
literal closes a function body, so a literal given to the body's own
variable on the body's last line no longer hides a save on the outer
variable of the same name.
2026-11-22 03:20:43 -08:00
dotCooCoo ff4fc193f8 Scripts: a later saveAs value in brackets ends the exemption
A literal such as `{saveAs: function () {}, saveAs: (doc.saveAs)}` kept
the first key's exemption, because the value's opening bracket had
already raised the depth when the key was read. The key is now read at
the depth outside that bracket, so the later value replaces the
function and `n['saveAs'](f)` is reported as a file write.
2026-11-22 03:08:00 -08:00
dotCooCoo c4edd76fc8 Scripts: only a whole var value makes an object's saveAs the script's own
The checker treats `x.saveAs(f)` as the script's own method only when
`x` was declared by a `var` statement, directly in a function body or
the global code, whose first name takes an object literal with a
`saveAs` or `exportFile` function as its whole value. The name counts
from the end of the statement.

- A literal given in a branch (`if (c) var e = {...}`), one the value
  goes on from (`{...} && doc`), one given by an assignment or to a
  later name of the statement, and a call inside the literal keep
  reporting the write.
- A function that gives an outer variable another value removes the
  exemption after the function body.
2026-11-22 03:00:50 -08:00
dotCooCoo 5f444df295 Save: a refused file ends a save of several files after the writer refuses it
When the file access in force refuses one of the files a save writes, the save
gives that file to its writer for the error, as before, and then returns the
error even when the writer did not refuse it, so the other files are not
written.
2026-11-22 02:48:26 -08:00
dotCooCoo 3a80afcb37 Scripts: only a function expression makes an object's saveAs its own
The script checker treats a saveAs or exportFile key of the script's own
object literal as the script's own method only when its value is a function
expression. A key holding another value, such as a document's method, is still
reported as a file write when called, and so is a key whose last value in the
literal is not a function expression.
2026-11-22 01:59:25 -08:00
dotCooCoo b82dddc71d Docs: G6 and M13 list Document.saveAs, Document.exportFile and app.open 2026-11-22 01:54:03 -08:00
dotCooCoo f31cb42fd8 Scripts: unlisted save, export and open options throw, and an object's own saveAs is not a file write
- saveAs, exportFile and app.open throw "<Class> has no option <name>" for a
  property their option class's help page does not list, instead of leaving it
  out. An undefined property is still left out, and PDFFileOptions also takes
  its read-only typename and parent.
- The script checker no longer reports a file write for saveAs or exportFile
  called on a variable holding the script's own object literal that defines
  that method, with `.` or in brackets. It reports it again once the method is
  assigned or deleted, the object is indexed with a computed key, or another
  name may hold the object.
- The read-only file test checks the open-document grant on its own, with no
  folder scope that also covers the file.
2026-11-22 01:49:59 -08:00
dotCooCoo 3f293b1c10 Merge main into feat/scripts-api-d6-save-export-open
# Conflicts:
#	docs/mcp.md
2026-11-21 20:46:03 -08:00
dotCooCoo b4ddcf9f39 Merge feat/scripts-api-d1a-app-documents into feat/scripts-api-d6-save-export-open
# Conflicts:
#	crates/engine/src/script/dom.rs
#	crates/engine/tests/it/script_host_vs_scriptcheck.rs
2026-11-21 20:02:27 -08:00
BFlat 1cf0a2806a Merge pull request #9045 from dotCooCoo/feat/quick-pen-arc-protractor-i9314
Pen: Quick Pen shows a protractor around an arc's center and snaps to its ticks
2026-11-22 10:54:06 +07:00
BFlat 7ad52eacb8 Merge pull request #9017 from dotCooCoo/fix/test262-runner-coverage
Tests: the test262 runner parses and runs the Annex B tests
2026-11-22 10:53:45 +07:00
BFlat f658b42bc6 Merge pull request #9013 from dotCooCoo/feat/psd-invert-threshold-posterize-layers
PSD import: apply Invert, Threshold and Posterize adjustment layers
2026-11-22 10:53:23 +07:00
BFlat 0aa2601eb9 Merge pull request #8995 from dotCooCoo/fix/3d-expand-inflate-bevel-twist-curves
3D: Expand Appearance keeps curves on Inflate faces, interior bevel edges and twist cuts
2026-11-22 10:53:03 +07: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
BFlat 3cc55c480e Merge pull request #8994 from dotCooCoo/fix/family-tool-prefs-keep-valid-counts
Tools: restored Spiral, Rectangular Grid and Polar Grid counts keep the current value
2026-11-22 10:52:41 +07:00
BFlat 980bd43e34 Merge pull request #8979 from dotCooCoo/fix/smooth-never-rougher
Smooth: a drag that reaches only a sliver of the next segment no longer splits it
2026-11-22 10:52:20 +07:00
BFlat 8f27f7c4ba Merge pull request #8978 from dotCooCoo/fix/unembed-keeps-current-mask
Links: Unembed leaves a released or edited clipping mask as it is
2026-11-22 10:51:59 +07:00
BFlat e6e376e1ca Merge pull request #8974 from dotCooCoo/fix/sample-color-stop-of-given-objects
Eyedropper: sampling into a stop of given objects reads their gradient
2026-11-22 10:51:39 +07:00
BFlat 1de9ad593c Merge pull request #8973 from dotCooCoo/fix/eps-freeform-plate-cells
Print: an overprinting freeform gradient leaves out the cells its plate samples write without ink
2026-11-22 10:51:19 +07:00
BFlat 0882bd3850 Merge pull request #8970 from dotCooCoo/fix/image-quad-malformed-corner
Native file: a distorted image with a malformed saved corner opens placed by its transform
2026-11-22 10:50:58 +07:00
BFlat 4cea62ceee Merge pull request #8969 from dotCooCoo/fix/live-paint-bucket-freeform-points
Live Paint: freeform point edits without a target leave the selection alone under the bucket
2026-11-22 10:50:38 +07:00
BFlat 6767fefb11 Merge pull request #8968 from dotCooCoo/feat/script-file-hidden-create-alias
Scripts: File.hidden can be set and File.createAlias makes a link within the grants
2026-11-22 10:50:17 +07:00
BFlat b2bcc0367c Merge pull request #8967 from dotCooCoo/fix/inline-refresh-test-created
Tests: the inline refresh test's two sessions share one created date
2026-11-22 10:49:56 +07:00
BFlat ce062ce2a5 Merge pull request #8966 from dotCooCoo/fix/pattern-commands-unknown-ids
Patterns: pattern and Repeat commands refuse an ids entry that names no object
2026-11-22 10:49:36 +07:00
BFlat c2e1e28f87 Merge pull request #8958 from dotCooCoo/fix/duplicate-item-aligned-to-identical
Appearance: aligned copies go to `to` when the stacks are the same
2026-11-22 10:49:15 +07:00
BFlat 467261f531 Merge pull request #8957 from dotCooCoo/feat/plugin-storage-fuel
Plug-ins: storage calls pay instructions for the bytes they move
2026-11-22 10:48:55 +07:00
BFlat 6ba9e7ab0a Merge pull request #8956 from dotCooCoo/fix/curvature-circle-skip-on-selection
Shapes: the Curvature Circle tool reaches its circles again after Deselect
2026-11-22 10:48:35 +07:00
BFlat bbf17b4daf Merge pull request #8955 from dotCooCoo/fix/save-for-web-fixed-palette-clear-slot
Save for Web: a Custom table keeps shifted and locked colors first, and 255 opaque colors beside transparent pixels
2026-11-22 10:48:14 +07:00
BFlat 261fa6aa8d Merge pull request #8946 from dotCooCoo/fix/restore-min-size-fits-work-area
Window: a restored window fitted to a small work area is not held at the minimum size
2026-11-22 10:47:54 +07:00
BFlat a79fab35fe Merge pull request #8945 from dotCooCoo/fix/scriptcheck-folder-ambiguity
Script checker: setting length, hidden or readonly on new Folder(...) or a Folder place is not a file write
2026-11-22 10:47:33 +07:00
BFlat 27c59e3125 Merge pull request #8941 from dotCooCoo/fix/symbol-art-ignores-layer-preview
Gradient: freeform Lines mode counts a symbol's stroke on a Preview-off layer of its art
2026-11-22 10:47:12 +07:00
BFlat 27e413fda5 Merge pull request #8936 from dotCooCoo/fix/dimension-level-snap-checks
Dimension tool: a line at a slight angle or past the distance limit is not a level
2026-11-22 10:46:51 +07:00
BFlat b288f27bd8 Merge pull request #8930 from dotCooCoo/fix/flare-lone-x2-y2-error
Flare: a lone x2 or y2 in shape.flare is an error
2026-11-22 10:46:31 +07:00
BFlat 2ec2894ae9 Merge pull request #8929 from dotCooCoo/fix/transform-null-origin-pivot-test
Tests: transform turns about the same pivot with a null or omitted origin
2026-11-22 10:46:11 +07:00
BFlat 29f5c65cdf Merge pull request #8926 from dotCooCoo/fix/soft-mix-rate-same-value
Pathfinder: setting Soft Mix's Mixing Rate to the value it has records no undo step
2026-11-22 10:45:51 +07:00
BFlat b3c83f75ba Merge pull request #8923 from dotCooCoo/fix/library-pattern-color-copies
Swatch libraries: repeated adds reuse numbered colors, and tints link to a color of their kind
2026-11-22 10:45:30 +07:00
BFlat 6e732cbe50 Merge pull request #8922 from dotCooCoo/fix/width-alt-double-click-keeps-selection
Width tool: an Alt-double-click on one of several selected points edits them all
2026-11-22 10:45:10 +07:00
BFlat a6fb037085 Merge pull request #8920 from dotCooCoo/feat/draw-behind-alt-drag-copy
Selection: an Alt-drag copy in Draw Behind goes directly below its original
2026-11-22 10:44:50 +07:00
BFlat 87b37f8bfc Merge pull request #8914 from dotCooCoo/chore/group-member-snap-origin-test
Tests: a selected group member's anchor is the point its move snaps by
2026-11-22 10:44:29 +07:00
BFlat b37556d626 Merge pull request #8913 from dotCooCoo/fix/point-tangents-close-samples
Path Precision Tools: Common Tangents keeps both lines from a point close to a round path
2026-11-22 10:44:06 +07:00
BFlat f7bbafe13c Merge pull request #8912 from dotCooCoo/fix/pdf-color-masked-cmyk-image-mask
PDF export: a color-masked CMYK image with an image mask keeps its hidden colors hidden
2026-11-22 10:43:45 +07:00
BFlat 4aa0de7867 Merge pull request #8911 from dotCooCoo/fix/revolve-surface-alpha-absolute
Tests: Revolve's surface alpha under colored lights is checked in absolute terms
2026-11-22 10:43:24 +07:00
BFlat 3766393be5 Merge pull request #8794 from dotCooCoo/fix/retype-remeasure-budget
Retype: a long evenly tracked run after irregular gaps keeps its tracking
2026-11-22 10:43:04 +07: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 d14830b6b7 Scripts: saveAs and exportFile refuse a file open for writing and scales under 1%
A save or export to a file that a File object holds open for writing throws "Script file is open for writing", and a command the script runs does not write such a file besides the one named (an SVG's images), so the bytes the File writes at the end of the run do not replace the output. horizontalScale and verticalScale take 1 to 776.19, since a raster export writes at least 0.01 pixels per point.

The script checker reports a document's saveAs and exportFile as file writes, and the host name check lists the save, export and open names, option classes and enumerations.
2026-11-21 17:36:55 -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 6404b0cebf Swatch libraries: hold the library's numbered names while a pattern comes in
A color a library pattern's art brings now skips the library's numbered
names while the pattern is imported, instead of being renamed after the
import. The rename also rewrote every other paint in the document linked
to the name the import first gave, such as art still linked to a deleted
"Ink 2", so adding the pattern changed that art. Now the names are held
with placeholder swatches during the import and removed afterwards, and
links that were already in the document stay as they were.

A pattern whose art brings both "Ink" and the library's "Ink 2" keeps the
library's "Ink 2" under its own name when the document gives "Ink"
another color, and the library's "Ink" takes the next free name. A library
pattern with a numbered name, such as "Tiles 2", keeps that name when the
document does not use it.
2026-11-21 17:31:08 -08:00
dotCooCoo ff26d5e4a3 Swatch libraries: colors a pattern brings skip the library's other names
A global or spot color that a library pattern's art brings under a
numbered name no longer takes a name the library gives another swatch.
Before, adding a pattern whose art uses "Ink" to a document with another
"Ink" brought the color as "Ink 2" even when the library has its own
"Ink 2"; adding that library swatch next then came in as "Ink 2 2". The
brought color now takes the next free name the library does not use
("Ink 3"), and every paint linked to it follows the new name, so adding
the library's "Ink 2" next adds it under its own name and adding both
again adds nothing.

A color the pattern's art brings or takes is the color a library tint
or gradient links to only when it has the library color's paint and its
process, global or spot kind, as for the other lookups in the same add.

The test a_numbered_copy_named_like_another_library_color_is_found now
makes the blue "Ink 2" itself, as an earlier version's pattern add left
it, since a pattern add no longer gives that name.
2026-11-21 15:38:19 -08:00