Scripts: style objects made before File > Revert go stale

A style object kept working after file.revert when the file read back held a style with the same name. Each style object now keeps the document's revert count, as text ranges do, and one made before a revert throws Stale style. The range style lists follow the per-paragraph entries of the text model, and the host name table lists the style classes.
This commit is contained in:
dotCooCoo committed 2026-11-21 18:47:00 -08:00
1 parent a2063cea75
commit de11e1e755
4 files changed
+69 -18

No files matched your search

+2 -1
View File
@@ -2760,7 +2760,8 @@ app through the global object `vc`, and writes to the Script Console and runs ot
paragraph the text touches. `clearingOverrides` left out is false. A range lists each style once, in the order
its text first uses it, the Normal style standing for text in no other style, and its lists cannot add or remove
styles. The Normal styles cannot be renamed or removed. A style object keeps naming its style after a rename made
through `name`; after the style is removed, renamed another way or its document closed, it throws `Stale style`.
through `name`; after the style is removed, renamed another way or its document closed or reverted, it throws
`Stale style`.
One run names at most 4,096 styles. `ParagraphStyle.characterAttributes` throws an error that says it is not
available yet.
- `$.write(...values)` writes the values to the Script Console with no separator, each as `String(value)` gives it, and