Commit Graph
241 Commits
Author SHA1 Message Date
.CooCoo c2e4966407 Merge pull request #9255 from dotCooCoo/feat/scripts-scriptui-resources
Scripts: ScriptUI builds windows and controls from resource strings
2026-11-28 08:03:55 -08:00
dotCooCoo 88fb7a8128 Merge main into feat/scripts-document-views 2026-11-28 07:25:53 -08:00
dotCooCoo ab6a0d44aa Merge main into feat/scripts-scriptui-resources 2026-11-28 05:12:02 -08:00
dotCooCoo 1d3e835927 Scripts: ScriptUI review fixes for heap-limit adds and removes, listeners, list texts, Enter, the run's questions and automation requests
- 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.
2026-11-28 02:43:06 -08:00
.CooCoo 87b3dd9a98 Merge pull request #9853 from dotCooCoo/fix/script-documents-strict-assign
Scripts: assigning documents throws in strict mode and is ignored otherwise
2026-11-28 01:24:23 -08:00
dotCooCoo 7d6abb1d23 Merge main into fix/script-documents-strict-assign 2026-11-28 00:29:51 -08:00
dotCooCoo eb4c8bdc81 Scripts: script code builds with main's revert test and command hook
main added a test named wrappers_go_stale_after_revert and passes the
command id to dom::before_command by reference.

- The revert test of this branch is renamed
  objects_read_before_a_revert_are_stale_and_ones_read_after_are_the_loaded_ones.
- command_value takes `id` as a &str, so the call passes it as it is,
  which clippy's needless_borrow check requires.
2026-11-28 00:09:25 -08:00
dotCooCoo e75b26cffc Merge main into feat/scripts-reflection 2026-11-27 23:38:58 -08:00
.CooCoo 8f9fda6a7d Merge pull request #9432 from dotCooCoo/fix/script-handles-after-revert
Scripts: invalidate page-item handles after file.revert
2026-11-27 23:34:31 -08:00
dotCooCoo a9799bfe9a Merge main into feat/scripts-scriptui-resources 2026-11-27 22:17:49 -08:00
dotCooCoo f7ccc194fc Merge main into feat/scripts-document-views 2026-11-27 22:14:06 -08:00
dotCooCoo f56fcd99f6 Merge main into feat/scripts-reflection 2026-11-27 22:13:50 -08:00
dotCooCoo 1371fdab0d Merge main into fix/script-handles-after-revert 2026-11-27 22:12:29 -08:00
dotCooCoo 1583808eec Merge main into fix/script-documents-strict-assign
# Conflicts:
#	crates/engine/src/script/dom.rs
2026-11-27 22:10:35 -08:00
dotCooCoo c97b5eac1e Merge main into feat/scripts-api-d7a-variables 2026-11-27 21:57:44 -08:00
.CooCoo a95a52e06a Merge pull request #9866 from dotCooCoo/fix/script-preset-field-size
Scripts: DocumentPreset settings refuse a value of the wrong kind or size
2026-11-27 21:54:22 -08:00
.CooCoo 25cbbeca4a Merge pull request #9802 from dotCooCoo/fix/scripts-documents-active-first
Scripts: app.documents lists the active document first
2026-11-27 21:43:33 -08:00
.CooCoo a628629f7d Merge pull request #9857 from dotCooCoo/fix/file-locks-unlock-on-drop
Locks: dropping a lock holder unlocks its file
2026-11-27 21:37:36 -08:00
dotCooCoo 8ff8dbefc6 Scripts: DocumentPreset settings refuse a value of the wrong kind or size
Assigning a DocumentPreset setting stored any value until the run ended,
and the value was checked only when addDocument read it. A script could
keep gigabytes of strings in presets that no addDocument would accept.

The setter now checks the value before storing it: a value of the
setting's enumeration, a finite number, a title of at most 4096 bytes,
true or false for documentBleedLink, or four finite numbers for
documentBleedOffsetRect. undefined unsets any setting, and the three
settings addDocument does not apply yet also take null. A value of
another kind throws a TypeError, a longer title throws a RangeError, and
the setting keeps its old value. addDocument still checks the ranges.
2026-11-27 20:16:03 -08:00
dotCooCoo b3917f89e8 Locks: dropping a lock holder unlocks its file
The plug-in store turn, the Data Recovery area hold, the script grants
lock and the hang report file each released their file lock only by
closing the file. The lock stays held while any copy of the handle is
open, and a child process that any thread starts holds a copy until it
runs its program. While one was starting, the next turn on the plug-in
store waited, an app found its own recovery area busy, a grants change
timed out, and the next launch left a hang report alone.

Each holder now unlocks the file when it is dropped, as #9837 does for
the nightly session and the GPU start file. The engine's three locks
share one type, `store::LockedFile`. A left hang report that a launch
locks to read is held the same way.

Each new test keeps a copy of the handle open, drops the holder and
takes the lock again.
2026-11-27 18:58:40 -08:00
dotCooCoo efb7911139 Scripts: assigning documents throws in strict mode and is ignored otherwise
The global `documents` has only a getter. The docs and the module and
test comments said only that assigning it keeps its value. They now say
that the assignment is ignored outside strict mode and throws a
TypeError in strict mode code or with `#strict on`, and the test also
checks the `#strict on` case.
2026-11-27 18:46:40 -08:00
dotCooCoo a354d09af4 Scripts: folder listings take their time limit from the session's clock
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.
2026-11-27 16:10:28 -08:00
dotCooCoo 55bf6604be Scripts: app.documents lists the active document first
A script's documents[0] was the first tab, not the active document, so
scripts that read app.documents[0] as the document in front acted on
another one. The scripting guide says documents[0] is always the active
document:
https://ai-scripting.docsforadobe.dev/scriptingJavascript/objectReferences/

Each open document now records when it last became the current one.
documents lists the current document first and then the others from the
one current most recently to the one current longest ago (VectorCraft's
own rule). documents["name"] and getByName search in the same order. A
change a script makes to a document in the back switches to it and back,
and that switch no longer moves the document in the list.

Three tests that read documents[0] as the first tab with two documents
open now read documents[1].
2026-11-27 13:22:06 -08:00
dotCooCoo cc2c5c770f Bound XMP metadata work and preserve packet boundaries 2026-11-26 19:15:16 -08:00
dotCooCoo 0669a4525a Merge main into feat/scripts-xmp-objects 2026-11-26 15:20:19 -08:00
BFlat 023843e3a6 Merge pull request #9114 from dotCooCoo/feat/scripts-startup-scripts
Scripts: run startup scripts at launch and before a chosen script
2026-11-27 05:13:16 +07:00
BFlat 3b73e8122b Merge pull request #9049 from dotCooCoo/feat/scripts-api-d7b-tags-notes-uuid
Scripts: PageItem.tags and Document.tags read, add, change and delete an object's tags
2026-11-27 05:12:59 +07:00
BFlat b59fd33542 Merge pull request #8951 from dotCooCoo/feat/script-grants-list
Preferences: list the script file access kept with Always, with Revoke
2026-11-27 05:10:54 +07:00
dotCooCoo bb439ce33b Merge main into feat/scripts-xmp-objects
XMP updates flush their destination folders on Unix. The host records completed writes and refreshes open readers before reporting a folder flush error. XMPFile retains its pending packet for retry.
2026-11-26 13:45:26 -08:00
dotCooCoo 051781e23d Merge main into feat/scripts-xmp-objects
Keep XMP file buffers in native state and release them at the file run boundary. Count registered namespaces and expanded metadata against the heap limit. Reset marked readers after updates and allow failed library setup to retry.
2026-11-26 13:13:53 -08:00
dotCooCoo bacc27e2f1 Merge main into feat/scripts-startup-scripts 2026-11-26 11:04:04 -08:00
dotCooCoo f9011cf8e2 Merge main into feat/scripts-api-d7b-tags-notes-uuid 2026-11-26 10:45:34 -08:00
dotCooCoo ca68753463 Keep startup queue failures and stop requests consistent 2026-11-26 10:37:22 -08:00
dotCooCoo 66724868b1 Merge main into fix/script-handles-after-revert 2026-11-26 10:24:41 -08:00
dotCooCoo 80a24bf8a6 Use each window's displayed zoom in script views 2026-11-26 09:36:45 -08:00
dotCooCoo 93a5d81d2e Merge main into feat/scripts-api-d7b-tags-notes-uuid 2026-11-26 09:34:56 -08:00
dotCooCoo 7da21d015c Validate and retain chosen scripts before startup runs 2026-11-26 08:56:39 -08:00
dotCooCoo f4704bb688 Scripts: reject protected page-item mutations 2026-11-26 08:35:37 -08:00
dotCooCoo 54ff9ac323 Scripts: invalidate page-item and layer handles after revert 2026-11-26 08:24:54 -08:00
dotCooCoo b64cbe2174 Merge main into feat/scripts-document-views 2026-11-26 08:05:40 -08:00
dotCooCoo e015b20396 Merge main into feat/scripts-startup-scripts 2026-11-26 07:31:10 -08:00
BFlat 2f4cceb462 Merge pull request #9074 from dotCooCoo/feat/js-promise-job-queue
Scripts: .js scripts have Promise and run its jobs before the run ends
2026-11-26 19:32:14 +07:00
BFlat aeb9f99e7e Merge pull request #9314 from dotCooCoo/feat/scripts-execute-menu-command
Scripts: app.executeMenuCommand runs a menu command
2026-11-26 16:49:34 +07:00
dotCooCoo 27c3f8cb29 Scripts: variables follow the topmost-first page item order and the gate's linked-file argument 2026-11-26 00:44:53 -08:00
dotCooCoo d1eb8c9503 Scripts: a startup listing over the script limit keeps the first names in order
The listing sorts the eligible names before it applies the limit, so the same scripts run on every launch.
2026-11-26 00:30:17 -08:00
dotCooCoo f6aef4fc8a Scripts: a queued list choice is dropped when a handler replaced the item, and the new items stay kept while counted
A list counts how many times a script replaced its items, so a choice queued
against an item a handler removed and added again with the same text is not
replayed against the new item. The items array stays kept from collection
while the count's slot reserves room.
2026-11-26 00:18:53 -08:00
dotCooCoo 5654c06c6d Scripts: ScriptUI review fixes for resource strings, list choices, listeners and the dialog's cancel and close
A resource string's characters size edit fields and static text, a list's items must be an array, a listener added again runs in a later dispatch only, a close asked for while the dialog is described closes it, a list selection a getter changes is read again, and Escape during a handler cancels the dialog the run waits at next. The thrown error of a failed host call stays kept while the failure callback runs.
2026-11-26 00:18:53 -08:00
dotCooCoo 3055ea5757 Merge main into feat/scripts-startup-scripts 2026-11-25 23:39:37 -08:00
dotCooCoo 2909471ebc Merge main into feat/scripts-api-d7a-variables 2026-11-25 23:38:36 -08:00
dotCooCoo 562bec3f1e Merge main into feat/scripts-api-d7b-tags-notes-uuid 2026-11-25 23:07:28 -08:00