Scripts: review fixes for the document defaults and the object model

- appearance.setNewArt is listed among the commands a plug-in may call, so
  every_command_is_reviewed passes.
- appearance.setNewArt refuses `tint` on a pattern that has no swatch entry,
  and its help and docs/mcp.md say an omitted `weight` keeps the stored weight.
- The dash checks of appearance.setNewArt, strokeDashes and
  defaultStrokeDashes share one helper.
- defaultStrokeWidth, defaultStrokeMiterLimit and defaultStrokeDashOffset
  compare exactly, so a slightly different value reaches new art.
- An RGB default in a CMYK document is compared in the document's color mode,
  and a color read back from a path or a default (a Gray too small for its
  value to name) assigns back without a command.
- addDocument starts from the profile's built-in first preset even when a
  saved preset has the same name.
- A saved preset's rows are read as at most 1000.
- The page item and path lists are kept for each open document, the
  selection list stops at its limit, the typename of a removed PathPoint and
  of a stale PathPoints or PathItems throws, and an item edit whose
  selection cannot be restored is undone with it.
- A path's subpath starts are counted once and kept while its points keep
  their layout, so reading or setting each of its points in turn no longer
  walks every subpath for each point.
- A run that ended while waiting for a growth answer is checked against its
  allowance again before it is kept.
- docs/mcp.md says which file limits apply to reading a profile's file.
This commit is contained in:
dotCooCoo committed 2026-11-25 15:07:36 -08:00
1 parent a61c4d87e8
commit f5afa0b84a
14 files changed
+425 -89

No files matched your search

+5 -4
View File
@@ -9147,8 +9147,9 @@ resets it.
`appearance.setNewArtBasic` rejects an `on` value that is not a boolean. Omitting `on` toggles the current preference.
`appearance.setNewArt {fill?, stroke?, weight?, cap?, join?, miterLimit?, dash?, dashOffset?, fillOverprint?,
strokeOverprint?}` sets new art's fill, stroke and stroke options whatever is selected, and leaves the selection, its
art, the active proxy and Recent Colors as they were. `fill` and `stroke` take a paint as `paint.setFill` does; a
stroke painted on new art without one gets a 1 pt weight unless `weight` is given. Every value is checked before
art, the active proxy and Recent Colors as they were. `fill` and `stroke` take a paint as `paint.setFill` does, and
`tint` only with a global or spot `swatch`. Without `weight` the stored stroke weight stays; a stroke painted on new
art without one gets 1 pt only when that stored weight is 0. Every value is checked before
anything changes, and any change while New Art Has Basic Appearance is off and an object is selected is an error. It
returns `{changed}`, false when the next object would look the same.
@@ -9462,8 +9463,8 @@ runs, as `document.open` reads its file when it runs. A file larger than 64 MiB
When the file cannot be read, is too large or is not a native document, or the request's read roots leave out the
folder (whether or not the file exists), the document starts with the defaults and
`file.new`'s result carries `profileError: {profile, reason}`; the desktop app shows the reason in the status bar, and
a script's `app.documents.addDocument` throws it. A script's file access limits do not apply to reading the profile's
file. The
a script's `app.documents.addDocument` throws it. Reading the profile's file is not limited to the script's folder (the
`File` and `Folder` rule in [Script engines](#script-engines)), but the request's automation read roots still apply. The
reason given when the read roots leave out the folder does not name the folder's path. Color profiles the profile's
file carries are installed when they are missing, as `document.open` installs them, and each one that can't be used
adds a line to `file.new`'s `warnings`. The new document's links find their files through relative paths from the