- move, remove() and zOrder throw "Only Image Trace can make a tracing",
with nothing changed, when they would leave an image at the bottom of
an ordinary group named Image Trace: a path moved out of the group or
to its top, Send to Back or Send Backward on the image, and Bring to
Front or Bring Forward on the object below it.
- releaseTracing() throws "Cannot release a tracing containing added
artwork", with nothing changed, when the tracing holds an object its
trace did not make. imageTrace.release keeps only the source image, so
the added object would be deleted.
- The TracingOptions members with no setting and TracingObject.areaCount
are left out of hasOwnProperty and reflect. Reading them still throws.
Docs: docs/mcp.md.
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.
Setting width, height, left, top or position on an item in a document in
the back measured the item before its document was made active. Making a
document active measures its type again where it is not measured yet or
where a composite font of the same name changed, so the scale ratio or the
move distance applied to bounds that no longer held, and the item ended
at a different size or place than the one asked for.
The measurement now runs inside the edit, after the switch, through a new
edit_item_with that edit_item also uses.
- move() and duplicate() refuse to put an image at the bottom of an
ordinary group named Image Trace, before the document changes, as
renaming such a group already does. A tracing's source image moved
out keeps its own error.
- pathCount and usedColorCount no longer walk the anchor points, and
anchorCount charges each path inside a compound path it reads.
- The run keeps the reverse of its replacement map, so finding the
first object of a chain no longer scans the whole map at each step.
- docs: the source image of a traced item is left out of pageItems,
placedItems and rasterItems and is reached through
PluginItem.tracing.sourceArt; docs/mcp.md lists the new error.
File.parent gives a folder in URI notation (/c/Users/..., with %20 for a
space). $.evalFile joined that text to the script's folder as written, so
on Windows $.evalFile(File($.fileName).parent + '/more.jsx') looked under
C:\c\Users\... and reported "include file not found".
When an absolute path starting with one / names no file the script may
read, $.evalFile now also tries it with its escapes decoded and, on
Windows, with /c/... as the drive C:. The path as written is still tried
first, and the scope check, the .. refusal and the file limits apply to
every form. Share and device paths are not converted, and #include lines
are read as before.
Cause: main's fe89d3f8 changed page_items to return a Result, since
building the list again now counts against the run's host-call allowance.
The image collections' list builder still used the old return type, so
vectorcraft-engine did not compile once main was merged in, and every
gate shard failed. The builder now passes the error on with `?`, as the
path and text lists do.
PageItem.name now refuses "Image Trace" for an unclipped group whose
first object is an image and that is not already a tracing. That name
would make the group a tracing, and expanding it would delete its first
object.
The snapshot of a tracing's objects is now taken only for a tracing
saved without the record of the objects its trace made, and only the
first time a run sees it. Retrace reads it only in that case.
docs/target-app-parity.md now says that the view options only change
the view, and docs/mcp.md lists the new rename error.
Tracing an Image Trace object again built a new group with default
object settings, so a tracing's opacity, blend mode and appearance items
were lost on each retrace. The new group now takes them from the tracing
it replaces.
After an option change replaced the tracing, a PluginItem read from a
collection or the selection was a different object from the one the
script already held. Handles to a replaced tracing now name the first
object of its chain of replacements, so they compare equal.
mask.duplicate(mask, ElementPlacement.PLACEAFTER) put the copy directly
above the clipping path without an error. A copy now goes through the
same refusal as other objects; move of the clipping path below itself
still leaves it where it is.
imageTrace.make records the ids of the objects it made in the tracing's
trace settings as `made`, and copying the tracing records the ids of their
copies. Tracing again through the scripting API throws, with nothing
changed, when the tracing holds any other object, whether it was added in
this run, an earlier run or by a command. A tracing saved without `made`
is checked only for objects added in the same run, as before.
- pageItems, pathItems and textFrames build their list of a document again
after every edit. The rebuild walked the whole document without counting
anything against the run, so a loop that edits and reads a collection in a
large document did unbounded host work. A rebuilt list now counts 16 bytes
per object (as the selection's list does) against the run's host-call
allowance, and the path and type lists count the page items they scan.
- An edit's own ordinary error was returned ahead of a stop (an uncatchable
Abort) from putting back the selection or switching back to the active
document, so a script could catch it and go on. A stop now comes first.
- An answer to a waiting call that could not be read as a value (nested too
deep, too many entries) ended the run instead of being thrown at the call.
It is now thrown there, where the script can catch it, and a ScriptUI dialog
that waited for the answer stops showing, as when its host call fails.
- The selection cost test also compares the host calls, under the same
64 KiB limit for both documents.
- PathItem point, paint, stroke and transform changes on a path on a locked
artboard now throw `Cannot edit` and change nothing, as the PageItem
setters do. `pathItems.removeAll()` deletes nothing when a path is on a
locked artboard, as `pageItems.removeAll()` does; it used to delete them.
- `move` and `duplicate` with `PLACEAFTER` and the clipping path of a clip
group or clipping layer as the relative object throw instead of putting
the object above the clipping path, or reporting success without moving it.
- `zOrder` counts the art above a clipping path and below the layer's ruler
guides, as the Arrange commands do, so a method that leaves the object
where it is runs no command.
Docs: docs/mcp.md.
app.getIsFileOpen treated any path with a backslash as a Windows path,
turning each backslash into a folder separator and ignoring letter case.
On macOS and Linux a backslash is a character of a file name, so
getIsFileOpen answered true for the path /work/a\b.ai while /work/a/b.ai
was open.
Paths now get the Windows rules only on Windows or when they start with a
drive letter.
DocumentPreset.typename and toString() answered for a preset kept from
an earlier run with #targetengine, while its settings throw a TypeError.
Both now check the preset the way the settings do.
Documents.addDocumentNoUI(startupPreset) was missing. It now makes the
document addDocument(startupPreset) makes.
- 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.
pathCount, anchorCount and usedColorCount skipped every group anywhere in
the tracing that looked like seam fills, so a group named "Seam Fills"
moved into a tracing was not counted. The counts now leave out a clip
group directly in the tracing that is seam fills, or the lowest item
above the source image for traces made before seam fills were clipped,
as retracing does. An Image Trace object inside the tracing leaves out
its own seam fills the same way.
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().
- 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).
main's Document member list held saveAs and close as members that are not
available yet; this branch's save_open members implement them, so the
merge drops them from that list and keeps main's other entries. The
script host test lists take main's members together with this branch's
open, userInteractionLevel, fullName, path, saved and option classes,
and the heap accounting keeps main's ModuleNamespace arm beside the
FsEntry string arm.
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.
The name, note, hidden, locked, opacity, blendingMode, position, left,
top, width and height setters checked the assigned value before the
item, so a bad value on a removed item reported the value error instead
of "Stale page item". Each setter now looks up its item first.