- imageCapture refuses a path that any open document's link is read
from: the stored path from the document's folder, the relative path
from the file the document was read from (a template opened as an
untitled document included), the name in those folders, and a DCS
image's plate files beside each of those places. Documents the
interface opened while the run was paused count too.
- new IllustratorSaveOptions() starts with compatibility
Compatibility.ILLUSTRATOR19.
- PageItem.controlBounds throws that it is not available yet instead of
giving the visible bounds.
- move and duplicate with PLACEAFTER and a clipping group's clipping
path as the relative object throw an error.
- The settings of one run's DocumentPreset objects hold at most 4 MB
together.
- A run keeps the page-item lists of up to 8 documents, so reads that
alternate between documents do not walk them again.
object.rasterize with ids now does what the same objects selected do:
an object listed with a group or layer that holds it is left out and the
group is rasterized, as edit::roots_of leaves it out of a selection.
Document.rasterize still throws an error for such a list before it runs
the command.
The checker lists Document.imageCapture with saveAs and exportFile as a
document method that writes the file it is given, and the host name
check gives it an OUTSIDE row. RasterizeOptions and ImageCaptureOptions
move to the bare classes, as the save and export option classes did.
A capture whose clipBounds miss all the art writes a blank image of that
area, and a new test covers it; docs/mcp.md says so beside the rasterize
rule, which throws an error for such bounds.
Document.imageCapture compared only paths that exist, so a capture to
the path of a linked image whose file is missing created the file the
document then loads from that link. Each path is now compared as its
folder's real path and its name, so a missing file counts too. A name
that differs only in letter case is the same file in a folder whose
names ignore case: the folder's own entries are looked up with their
ASCII letter case swapped, and on macOS the nearest folder above on the
same volume. When neither tells, the capture is refused.
Document.rasterize(sourceArt, clipBounds?, options?) replaces one page
item or a list of them with an embedded image in one undo step and gives
the new RasterItem; the source objects go stale. Document.imageCapture(
imageFile, clipBounds?, options?) writes a PNG of all the visible art,
on the artboards or off them, or of the area clipBounds names. new
RasterizeOptions() and new ImageCaptureOptions() start with the
defaults the help pages give, and the enumerations AntiAliasingMethod
and RasterizationColorModel hold their values. Every option goes to the
command explicitly, so the document's raster effects settings do not
change the result.
object.rasterize takes ids, to rasterize those objects instead of the
selection while keeping the selection less the replaced art, and
clipBounds, which cuts the image to a rectangle that must reach the art
itself. Its result adds imageId, the image inside the clip group when
clippingMask makes one.
VectorCraft's own rules: clipBounds is [left, top, right, bottom] in
the script's coordinates and is never reordered; imageCapture writes a
PNG and needs a .png name; transparency wins over backgroundBlack and
over matte; padding takes 0 to 1,000 points and both resolutions 72 to
2400 ppi; an image over 64 megapixels or 32,768 pixels a side throws
before anything is drawn. imageCapture writes only where the script's
File objects may, and never over an open document's file or a file one
of them links, wherever the linking image or placed document is stored.
convertSpotColors, convertTextToOutlines and includeLayers set to true,
and Document.windowCapture, throw an error that says they are not
available yet.
A New Document profile file that is a link or a folder is no longer read:
the read is exempt from a script's file gate, which never checked where a
link leads. file.new reports it as a profileError with the reason "not a
plain file".
Reading a DocumentPreset setting now counts the value it returns toward
the data a run may pass, as assigning it does, and addDocument counts the
preset's settings before copying them.
The removeAll() test on a locked artboard now also holds an object on an
unlocked artboard and checks it is still there after the call throws.
PageItem.remove() and PageItems.removeAll() checked only whether the
object and its layers and groups were shown and unlocked, then passed the
ids to edit.clear, which deletes named objects without checking artboard
locks. Both now throw "cannot delete objects on a locked artboard" with
the object ids and delete nothing, as art on a locked artboard is not
editable elsewhere in the document.
A save or export to a file that a File object holds open for writing throws "Script file is open for writing", and a command the script runs does not write such a file besides the one named (an SVG's images), so the bytes the File writes at the end of the run do not replace the output. horizontalScale and verticalScale take 1 to 776.19, since a raster export writes at least 0.01 pixels per point.
The script checker reports a document's saveAs and exportFile as file writes, and the host name check lists the save, export and open names, option classes and enumerations.
A global or spot color that a library pattern's art brings under a
numbered name no longer takes a name the library gives another swatch.
Before, adding a pattern whose art uses "Ink" to a document with another
"Ink" brought the color as "Ink 2" even when the library has its own
"Ink 2"; adding that library swatch next then came in as "Ink 2 2". The
brought color now takes the next free name the library does not use
("Ink 3"), and every paint linked to it follows the new name, so adding
the library's "Ink 2" next adds it under its own name and adding both
again adds nothing.
A color the pattern's art brings or takes is the color a library tint
or gradient links to only when it has the library color's paint and its
process, global or spot kind, as for the other lookups in the same add.
The test a_numbered_copy_named_like_another_library_color_is_found now
makes the blue "Ink 2" itself, as an earlier version's pattern add left
it, since a pattern add no longer gives that name.
Setting selected to true or false runs select.add or select.toggle for that one object, so the
other objects keep their direct-selected anchors and segments and the key object. Before, it
replaced the selection with whole objects.
A press keeps the pointer and the snapped point for the end of the piece it adds. When Alt
changes the action during the press, the end goes through the protractor's tick again for the
new action, so a continuous arc that snapped to a tick and becomes a sharp-corner arc ends at the
pointer, and a piece that becomes a continuous arc goes onto the tick, without waiting for the
next drag. This also covers a press that has not dragged.
- new DocumentPreset() now makes an object of the DocumentPreset class whose settings the run
keeps, so addDocument refuses a plain object, one with a typename of DocumentPreset included,
with a TypeError naming presetSettings.
- When file.new reports a profileError, addDocument throws an error that names the profile and
the reason, and the document made with the defaults is put back.
- A script's file.new reads the New Document profile file in the app's own profiles folder;
the automation roots in force still apply. Before, the script's file gate refused the folder,
so a scripted addDocument never used an edited profile.
Docs: docs/mcp.md.
Scripts save, export and open documents through Document.saveAs,
Document.exportFile and app.open, with IllustratorSaveOptions,
EPSSaveOptions, PDFSaveOptions, ExportOptionsPNG24, ExportOptionsJPEG,
ExportOptionsSVG and a PDFFileOptions record, the ExportType and related
enumerations, and app.userInteractionLevel. Each method runs file.saveAs,
document.export or document.open inside the run's transaction.
- A File argument reaches the host as its path only when the File class
made it: the path is held in an internal slot that scripts cannot set,
and a plain object that imitates a File is refused.
- Each path is checked as a File opened for reading or writing would be,
before the command runs, and the command's own reads and writes are then
held to the script's grants, leaving out the open documents' files.
A read-only file is not written over.
- Options a command maps are applied; a listed option that is not mapped
is accepted only at its documented default, and any other value, a bad
type or an out-of-range number throws before anything is written.
Without options, saveAs to a .ai, .eps or .pdf path and exportFile as
PNG24, JPEG or SVG use the defaults a new options object holds. With
pDFPreset named, a PDFSaveOptions option still at its default keeps the
preset's value. A raster export at 100% has one pixel per point.
- An export or save that writes several files, such as an SVG that writes
its embedded images beside it or an EPS with a file per artboard, checks
every path before writing the first.
Docs: docs/mcp.md, docs/target-app-parity.md.
A continuous arc that starts a path has no direction to follow and
sweeps the arc size, as a sharp-corner arc does. Moving its end onto a
protractor tick put the end on a circle the drawn arc does not follow,
so `tick_end` now gives no tick for it.
The hover keeps the snap settings it was made with (`SnapSettings` in
guides/snap.rs: the window, zoom, snapping options, tolerances,
Alignment Guides and construction angles). After one of them changes
under a still pointer, the hover's rubber band, protractor, distance
label and Smart Guides are hidden until the pointer moves, also through
a press, so the preview shows no point that a click would not place.
A press also drops the hover, so after a click puts an arc's end on a
tick no preview runs from that end back to the pointer. While the
pointer hovers, the tool asks the canvas to hover it again when the
view, the document or the selection changes (`wants_rehover`).
remove() on an object that is hidden or locked, sits in a hidden or locked layer or group, or is a group holding such an object now throws and deletes nothing, the same rule pageItems.removeAll() applies. docs/mcp.md states both rules and that width and height scale along the page's axes.
While an arc is drawn, by a drag or as the piece the next click adds, the
Quick Pen tool shows a protractor around the arc's center: a tick every 15°
from where the arc starts, a longer one every 90°, and one where it ends. The
piece the next click adds shows its protractor only while Enable Rubber Band
for the Pen tool shows that piece.
With Smart Guides on, the end of a continuous arc snaps onto the nearest tick
of its protractor, on the same circle, when the tick lies within the snapping
tolerance of the pointer, no other Smart Guide snaps the point, and neither
Snap to Grid nor Snap to Pixel snaps drawn points. A sharp-corner arc sweeps
its arc size, so its end does not snap. Shift does not constrain Quick Pen
points, so it does not change the snapping. The protractor, its 15° step and
the snapping are VectorCraft's own behavior.
The Smart Guides targets now also report whether a point landed on one of
them (`Targets::snap_hit`), so a target whose label or line is hidden still
takes precedence over a tick.
Adds tests for the arc's circle, the tick snapping by drag and by click and
its precedence, and the protractor during a drag and while hovering. Also adds
tests of existing Quick Pen behavior: a point snapping to a Smart Guide, and
the distance label shown while hovering.
A pass-through group's adjustment layers count as kept to change what is
below the outer pass-through group only when nothing below that group in
the outer one draws, as for adjustment layers directly in the outer group.
Before, a layer merged above them for its blend mode merged them applied
but the import counted them as not applied.
docs/mcp.md now says when a layer's mask hides all of it.
The host name test now has rows for app, the document model classes and the enumerations the script host adds. zOrder on a path inside a compound path throws an error and leaves the document unchanged, as duplicate does.