script::folder::list and script::startup::list measured the 250 ms
listing limit (MAX_SCAN) with a real Instant. script.listInstalled,
script.startup.run and the File > Scripts menu read the folders through
them, so a test that went through any of these got a truncated listing
and missing scripts whenever the disk stalled for 250 ms.
- folder::Clock is either Wall (the real time since the listing started,
the default) or Fixed (the same time at every check). Both list
functions take one.
- Session::set_script_listing_clock sets the clock the two commands and
the menu's listing job use; the app keeps the real clock.
- The script folder, startup script, scripts menu, script run and Safe
Mode tests list with a fixed zero time, so a slow disk cannot cut a
listing short. Direct listing calls use the test file's list helper.
- New tests check that script.listInstalled, script.startup.run and the
menu stop at the session's clock once it is past the limit and list
everything at the limit.
- A read or write that reaches a module namespace through a prototype
chain checks the export's temporal dead zone and refuses the write;
for-in over a namespace lists its keys without reading the exports.
- `delete this.x` and a delete inside `with` remove only the property,
so a later `let x` is still a SyntaxError.
- An arrow function's `length` is configurable.
- `let [` cannot start the body of if, else, while, for or a label.
- A specifier with an unpaired surrogate parses; the loader refuses it
before reading any file.
- Each module's code counts against the heap from when it loads, and
export lookups use an index instead of copying export lists.
- A module reached again through another path is not read or counted
against the 32 MiB source limit again, its relative imports are read
from the folder the file is in, and on Windows two files whose names
differ only in case in a case-sensitive folder stay two modules.
- `$.evalFile` in a module reads beside that module.
- `script.run` takes `module`, and a `.mjs` file picked on the web runs
as a module.
- Without `es2015`, the compiler does not collect the block scopes that
only Annex B block functions read.
- The test262 runner grades negative module tests by their phase and
counts panics on their own.
A script can play an action by name with app.doScript(action, set,
dialogs?), the DoScript method of the scripting reference. script.run
takes a new `actions` param, and the app fills it with the Actions
panel's actions and their included steps; a recorded command.batch step
gives its own steps.
- The action and its set are matched by their exact names. A name that
matches no action or more than one, an action with no included step,
a stop, and a step a script may not run or the engine does not have
(a View menu step, or one that plays an action or runs a script)
throw before any step runs, so an action cannot play itself.
- Each step runs as vc.run runs a command: it joins the run's one undo
step for each changed document, counts as a host call, and reads and
writes files only where the script may. A failed step is put back and
its error gives the step's place, the action and the command.
- A step that acts on the active artboard (paste in place, in front and
in back, Align, Distribute Objects and Distribute Spacing to the
artboard, All on Active Artboard, Edit Symbol, Fit to Artwork Bounds
and Fit to Selected Art) and names no artboard gets the active
document's active artboard, as the Actions panel's playback gives it.
The index is the one the artboard had as the run started, clamped to
the last artboard after a step deletes artboards. While the Artboard
tool has several artboards selected, a paste step gets none and Fit
to Artwork Bounds gets those artboards.
- dialogs must be true or false (default false). app.loadAction and
app.unloadAction throw an error that says they are not available yet.
- `actions` is checked before the script starts: at most 4,096 actions,
10,000 steps an action, 100,000 in all and 16 MiB.
The menu item checked a listed script and then ran script.run by its path,
which opened the file again; a link put in place of the file or a folder on
its path in between could make it run a file the check never saw, and the
include folder was looked up from the path again as well.
script.run takes installed: true. With a path it reads the file once through
script::folder::read, runs that text, and reads #include and $.evalFile in the
Scripts folder's real path followed by the names that read found. The menu
item runs script.run {path, installed: true}.
Under --automation-read-root, an error about a file or folder the client
did not give now names it whole only when it is inside the read roots.
Outside them it names the file or folder by its file name, or as "a file
or folder outside the read roots" when it has none, and keeps the roots
and the reason. A path the client gives stays whole.
This covers a save without a path (the document's own file and the files
written beside it, also inside action.batch, and the refusal to write
over a file read with losses), file.revert, script.listInstalled,
plugin.reload without a path and plugin.list's folder report, and
links.relink with copy (the document's folder, its error when the
document's path has no folder, and the copies in the reply). Export for
Screens' refusal for an export preset's folder uses the same helper.
A script renamed to its whole file name could take the label another
script kept, as with tidy.js, tidy.jsx and tidy.js.js in one folder.
The rename now repeats until no label is shared. A folder entry whose
type cannot be read now marks the listing as incomplete.
File › Scripts now lists the .js and .jsx files of the Scripts folder next
to the preferences, each named after its file without the extension, with
each subfolder as a submenu, above Check Script… and Other Script…. The
help page describes this listing:
https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/install-and-run-scripts.html
Choosing a listed script runs it through script.run without the warning
Other Script… shows. script.listInstalled returns the same listing, and
ui.runInstalledScript {path} runs one entry.
VectorCraft's own rules: the folder is read off the UI thread when the
app starts, when its window becomes active and when the File menu of the
window's menu bar opens; only names are read; links, junctions, hidden
and system entries are left out and checked again before a run; one read
stops at 2,048 entries, 512 scripts, 128 subfolders, 4 levels or 250 ms
and the menu then notes that some scripts were not listed. Under an
automation read root, script.listInstalled and ui.menu.list leave out a
folder outside the root.
#1183 (LloydNicholson) also proposed a Scripts menu listing a folder.