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.
- The grid-by-column test now checks each artboard's row and column, so
RLGridByCol must fill from the rightmost column. It compared only the
number of distinct rows and columns before, which a left-to-right fill
also passes.
- The keepEmpty test asserts that keepEmpty false deletes the compound
path, instead of accepting any state other than an empty compound.
- The addDocument profile test closes the profile document before the
script reads the profile, so the read goes through the app-folder
exemption and not through the rule for open documents' files.
- The report-origin test adds authored ReferenceError controls for
Window and activeDocument, and for BridgeTalk thrown as an error
object, so a hint list that grows to those names cannot change a
message the script wrote.
- New Document profile tests, and the temporary folders and files in
script_dom.rs and script_run.rs, use vectorcraft_testkit::TempDir, so
a failing assertion no longer leaves process-id folders behind. The
linked-profile test keeps its link target in the same temporary
folder.
Async function activations now save and restore this_in_env, strict_class, new_target and this_env with main's Frame fields. The string spread test sets its fuel above what main's iterator-based spread takes.
Proxies join main's construct path in class_ops.rs: new and Reflect.construct both run the construct trap there, with new.target passed through. A Symbol-key lookup passes through a proxy to its target, so spread and for-of read a proxy of an array with the array iterator.
- Adding a control or an item, and removing items, builds both arrays
before the first write, so a run that ends at the heap limit leaves the
lists and the dialog's counts as they were.
- A listener registered after an event started does not hear it in a later
phase, a capturing container's re-registration included.
- show() reads the dialog again when a getter changes a list item's text
after the item was read.
- Enter and Escape skip an OK or Cancel button inside a hidden or disabled
container.
- A resource string of a name and a type without braces throws a
SyntaxError, and a \u escape pair of surrogates reads as one character.
- In the app, queued events wait while another dialog is open over the
script's dialog, and the run's own questions wait while a popup, such as
an open drop-down list, is over it. ui.dialog.confirm and
ui.dialog.cancel take only the dialog, ui.dialog.set needs a field or an
action and answers with the dialog it set, and OK is refused while a
dialog open over it waits. A cancel after typed text clicks the cancel
button the dialog has when its turn comes, and an immediate cancel the
run refuses is an error.
- A click on a list box row gives the list the keyboard focus.
- The vc hint test names BridgeTalk, since Window now exists; the params
text and docs/mcp.md say that a show() in a handler notify runs throws
only in the app, and define_script_ui says when end is not called.
Window is defined now that ScriptUI dialogs run, so new Window('dialog') no longer fails with the advice that names the `vc` object. an_error_names_the_script_its_place_and_kind and failed_script_report_keeps_message_and_adds_origin use new BridgeTalk() instead, which still fails with that advice.
- `pageItems`, `pathItems`, `groupItems` and `compoundPathItems` of a
layer or group, the document's `pathItems`, `layers` and `artboards`
read with a name give what `getByName` gives, and a name nothing has
is not `in` them. Before, only the document's `pageItems` did.
- A compound path's `pathItems.removeAll()` keeps the compound path,
empty, as `remove()` of its last path does. Before, the compound path
was deleted too and the collection went stale.
- A Live Paint group's `pathItems`, `groupItems` and
`compoundPathItems` throw `Cannot add an object to a Live Paint group`
and make nothing. Before, a new path joined the group's source paths
and the script got back an object that was not in the collection.
- After each command, the points the run read are checked only for the
paths in the parts of the document that changed, so a script that
reads points of many paths and then edits each one no longer looks at
every path after every edit.
- A script that ends with nothing left to write, past the growth
allowance the last answer gave, is asked again before its changes are
kept, as one that writes point changes at the end is.
- A new object of a host class adds its handle to the heap's total, as
a collection counts it, so objects made between collections cannot
go past the heap limit.
Docs: docs/mcp.md (collection errors, artboard index errors).
- `toString()` on a page item list from a closed or replaced document throws
"Stale document", as its other members do.
- A member a host class declares unavailable is not reported by
`hasOwnProperty` or `propertyIsEnumerable` even when a parent class has it.
- Assigning a name an object of a host class inherits from a prototype no
longer calls the class's indexer, so a non-strict assignment is ignored
instead of throwing.
- Assigning a selection checks repeated objects with a set instead of
scanning the list for each object.
- The script report test throws a text that names `Window` for the case of
an error the script wrote itself.
- controlBounds takes in the paths' direction handles. A clipping
group's are its clipping path's.
- A compound path's pathItems is a PathItems collection: add() and the
shape methods make the path inside it.
- resize() scales and sets the stroke weight as one step, so a failed
stroke change undoes the scale too.
- A point change that adds or removes anchors deselects the path's
direct-selected anchors, from a script and from path.setAnchors, so
other anchors are not left selected in their place.
- A script that ends past the allowance of the last answer is asked
again before its changes are kept.
- documents.addDocument starts from the built-in preset when a saved
preset has its name, and Recent keeps the built-in preset's name.
- Saved preset rows past the artboard limit read as the limit.
- Host classes that do not fit the heap end with the heap limit.
- Layers keep their list while the document is unchanged, and getByName
charges its scan on a kept list too.
- Selection ids are deduplicated with a set.
- A path made on the current layer is made in one step, so a failed
stroke or reversal after it undoes the path too.
- Path points are found through a kept index of where each subpath's
points start, rebuilt when the path's points change, so reading every
point of a path with many subpaths is no longer quadratic.
- A pixel-aligned compound path snaps a path moved into it.
The script host ran its realm with E4X off, so XML literals were syntax
errors and XML, XMLList, Namespace, QName, isXMLName and
setDefaultXMLNamespace were missing from every script, although
vectorcraft-js has them. script.run and File › Scripts now turn E4X on
for .js and .jsx files, script text, #include files, $.evalFile, eval
and Function, and for a #targetengine engine.
script.check lists the e4x and xml features under the language need
instead of hostOnly, since VectorCraft runs them.
New Document moved to the craft UI framework on main. More Settings'
Columns now shows the columns a preset's rows give the current number
of artboards, a new column count replaces those rows, and a new layout
keeps the columns they showed.
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.
A realm made without Options::es2015 adds Proxy and Reflect at its first run with the option, and keeps them when the option is turned off. A Proxy or Reflect global that an earlier run defined stays as it is.