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.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 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.
- 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.
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.
docs/target-app-parity.md gets a line for the file.write report on a
File object's length, hidden and readonly and for the test that lists
every name the script host adds, with the tests that cover them. The
test's comment on vc no longer names another app.
Setting a File object's length truncates or pads the file, and setting
readonly or hidden changes it, but script.check reported no outside
category for those assignments. It now reports file.write and
filesWritten for them: plain and compound assignment, ++ and -- before
or after, and the property name as a string literal in brackets.
A new integration test lists every global and member the script host
adds to the JavaScript engine (the own properties of the global object,
of each object or function it holds and of each function's prototype,
compared with a plain engine) and fails when one has no row. Each name
that reaches outside the document has a probe script, and the test
checks that script.check gives it the expected outside id. vc is listed
as not checked: script.check reads scripts written for the reference
app's scripting, and what vc.run does depends on the command. The test
also checks that the checker lists every preprocessor directive the
host reads, through the new DirectiveName::ALL.
File object properties:
https://extendscript.docsforadobe.dev/file-system-access/file-object/