The scripting reference gives unitScaleRatio as the ratio, as a
percentage, by which the output is scaled, from 0 to 1000. exportFile
passed it to the DXF writer as drawing units per unit, so 100 wrote
the drawing 100 times too large and 1 wrote it at full size.
- The value is divided by 100 before it reaches the DXF writer, and a
value left out still writes at full size (100).
- A value below 0.0001, which the writer's smallest scale cannot
represent, throws a range error at the script instead of an error
about the DXF scale from the writer.
- docs/mcp.md describes the percentage and the default of 100.
The option was added in #9266.
The 256 MiB document limit sat in Disk::open_target, which
placedItems' file assignment also calls, so an oversized image was
refused as "Script document exceeds 256 MiB" before its own check
("is larger than 256 MiB") ran, and
placed_file_refuses_bad_values_without_changing_the_document failed.
app.open now checks the document size itself after open_target, and
open_target still reports a failed metadata read as a read failure.
A new IllustratorSaveOptions left compatibility unset, so a script that
read it before setting it got undefined. It now starts at
Compatibility.ILLUSTRATOR19, the documented default, which saveAs already
accepts without changing what it writes.
- An option that is not mapped accepts only its exact default, so
`bitmapResolution = 0.0000000005` throws that it is not available.
- Paper `width` and `height` take 0 or 72 to 14,400 pt, checked when they
are assigned, as `file.print` requires for a custom size.
- An assigned `position` places an untiled job when the base settings hold
a placed Print Tiling origin. The saved settings keep the origin.
- The `app.open` size limit in docs/mcp.md is the 128 MiB a script command
reads, with the 256 MiB error above that.
- The backslash file name test asserts the result of each platform, and
the printArea test checks that the page is artboard 2.
A native save keeps every artboard in its main file and reads `range` only
for the separate files of `separateArtboards`. The close check treated a
native document last saved with `range` and without `separateArtboards` as
a save of some artboards, and refused to close it although the save writes
every artboard.
`Document.saveAs` without options read the format from the path as
written, so on Windows `drawing.svg.` or `drawing.svg ` saved in the
document's own format under an SVG name. It now uses the format the
file name gives without its trailing dots and spaces, as
`save_format_for_name` reads it.
- The 1000% scale limit applies only when Fit to Page is off, since the
scale factors are not used with it on.
- A script run clears the print command allowance when it ends, so a
panic inside print cannot leave file.print open to later runs.
- saveAs without options takes the format from the path the script
names, so a link at that path cannot change it.
- A File the host gives back charges its path to the heap.
- DocumentPreset.typename throws for a preset from an earlier run.
- Documents.addDocumentNoUI throws that it is not available yet.
- The print tests remove their folders when an assertion fails.
Takes #9052's File and Folder design: a File keeps its path in
Class::FsEntry, which now also holds the native slots this branch keeps
out of a File's own properties. Hosts give File and Folder values with
file_ref and folder_ref, so the separate File ref writer is removed.
The save, export and open warnings keep the full method name as their
prefix (Document.saveAs:, Document.exportFile:, app.open:,
Document.close:). A script command's read stops at the smaller of the
script read limit and a scoped read limit, so app.open's limit no
longer skips the script read limit. PageMarksTypes is defined once.
The enumerations whose default member an option keeps (OutputFlattening,
CompressionQuality, the PDF color, compression, mark and security enums,
and the SVG encoding, DTD, CSS and font enums) are now defined, so a
script that sets an option to its default no longer throws a
ReferenceError; another member still throws as not available yet.
saveAs, exportFile, app.open and close with SAVECHANGES refuse a path
whose real file name is not valid UTF-8 instead of writing to or opening
a file named with a lossy copy of it.
- Moving a tracing's source image out of its tracing throws instead of
breaking the tracing.
- PlacedItem.file places and checks the linked image under one savepoint,
so a failed check leaves no linked image behind.
- Retracing restores the selection under the same savepoint as the trace.
- matrix assignment compares the linear part exactly, so a small change
to the scale or rotation is applied.
- ExportOptionsPNG24 and ExportOptionsJPEG accept white, their default
matteColor; another color is still an error.
- File objects made without charging their path no longer reserve it.
- Tests: the RTL artboard column check reads the direction from the
layout, js_path escapes line breaks and quotes, rejected tracing
options leave the saved document unchanged, and the Image Trace panel
targets a second image selected with its tracing's source.
- docs/mcp.md: the scale and clipping options apply to PNG24 and JPEG,
and the source image move error is documented.
- document.open refuses page, cropTo, pages and crop when a named importer reads the file (linkPages
still uses the built-in reader).
- exportFile with explicit null options throws a TypeError for GIF, PNG8 and TIFF too.
- close(SaveOptions.SAVECHANGES) saves a modern .ai or .ait file and an SVG file with Preserve
Editing whatever range was remembered; a range the save refuses still refuses.
- The script checker keeps a try statement's catch and finally, and an else after a nested
do-while, inside the loop body; a line break after a label does not start a new statement; a
this assignment in a function that hides a global clears the global's saved methods; and
holder.d['saveAs'] = ... no longer counts as a write to d.
- docs/mcp.md describes which files keep every artboard on close.
- Retracing a tracing that holds artwork added after the trace throws before
the document changes; the retrace limit counts retraces, not mappings.
- Image Trace warnings from trace and option changes go to the console.
- PlacedItem.file resolves the link against the document's folder.
- saveAs picks the format from the name it was given before resolving aliases.
- controlBounds includes handles inside blends, envelopes and other containers.
- document.open with an explicit PDFCROPBOX crop opens on the crop box
of a file with editing data; the default keeps the trim box and bleed.
- Closing with save changes keeps an EPS document's artboard range, since
the EPS file holds the whole document.
- The script checker treats a writer receiver captured from an outer
scope as able to change before each call, and finds the loop that holds
a call with a binary search instead of a scan of every loop.
- trace(), retracing, expanding, releasing and view changes refuse a locked
or hidden item, or one on a locked artboard, and leave it unchanged.
- exportFile writes the export's warnings to the script console.
- saveAs without options refuses a path whose extension names no format,
after the path's grant check.
- tracing.parent returns the same PluginItem handle the script holds, and a
placed item bound by assigning file is the same object in collections.
- PluginItem.isTracing goes stale with its TracingObject when the original
source image is gone.
- Expanding a tracing removes only its source image; other images a script
moved or duplicated into the group stay.
- A TracingObject goes stale when its original source image is gone, even
when another image now sits first in the group.
- Tracing, retracing, expanding and releasing restore the whole selection,
anchors and segments included, with only the replaced object remapped.
- app.open writes the open's warnings to the script console, as saveAs does.
- embed() checks the image's link state after the command instead of a
returned id rounded to a JavaScript number.
- The placed-image tests pass ordinary drive paths to File on Windows.
Document.close(SaveOptions.SAVECHANGES) now judges artboard loss by the
file the save writes. A PDF last saved with useArtboards: false is
refused, since it holds one page of the art's bounds. A native or .ai
file saved with separateArtboards is saved and closed whatever its range
names, since the range picks only the separate files; a version 7 .ai
file keeps the range check.
Document.saveAs, Document.exportFile, app.open and the save that
close(SaveOptions.SAVECHANGES) runs write each warning of their command
to the console after the method's name (for example "saveAs: SVG keeps 1
of the document's 2 artboards ...").
Script Check reports a file write for a saveAs or exportFile call on the
script's own object when the variable is assigned in a loop around the
call, since a later iteration may run the call on a document. Loop bodies
without braces follow if, else and line breaks, and a variable of the
same name that a function declares is kept apart.
A test shows that a waiting point change counts as unsaved for
Document.saved and close().
A multi-file save whose destination fails the access check now returns
that error without calling the writer. app.open refuses a document
larger than 256 MiB, checked from the file's size and again while the
file is read. On Windows, print and exportFile read the format from the
file name with trailing dots and spaces removed, as saveAs does. The
script checker reports app.open and app['open'] as file reads.
- Document.saveAs writes each warning file.saveAs gives to the console as a
line that starts with "saveAs: ", and still returns undefined.
- A save, export or open of a File the script names no longer reads a file
an open document links to outside the script's grants.
- A save or export that writes several files checks that no folder is where
one of them goes before it writes the first, so none of them is written.
- Moving the source image of a tracing within its tracing, and zOrder on it,
leave it first; zOrder SENDTOBACK on another object in a tracing puts it
just above the source.
- The two new script file errors are English only; their catalog rows are
removed (translations go through storytold/craft-i18n).
The images, tracing and save/open members now carry the type and
argument descriptions that main's Described lists expect, and
PlacedItem.contentVariable comes from the variables members. A
placedItems.add() handle now records the document's revert count, so
reading or assigning its file after File > Revert throws Stale page
item and places nothing, as other page items do.
- An assigned empty artboardRange prints every artboard instead of the saved range.
- Save and export refuse two destinations that resolve to the same file.
- Script file paths that are not valid UTF-8 are refused.
- PrintJobOptions.file keeps the assigned File, so a later name change is printed to.
- app.open of a template link opens an untitled copy.
- CUSTOMPROFILE with no profile assigned or saved is refused before printing.
- A destination named .ps writes PostScript.
- The save description limits its no-write guarantee to failures found before writing.