Files
vectorcraft/docs
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
..
…