Main gave every class member a reflect type and page item handles a revert
count. The type classes now declare a type for each member, their members
that are not available yet use the unavailable form, TextFrame takes main's
contentVariable, and a text range looks its frame up at the document's
current revert count.
Review fixes:
- A text range length that ends inside a surrogate pair moves its end out
to the end of the character.
- textFrames.removeAll() refuses type on a locked artboard, as
pageItems.removeAll() does.
- Joining a story's text across its frames counts toward the run's data
limit.
- A test shows a script that catches a refused link goes on with the links
unchanged.
Keep XMP file buffers in native state and release them at the file run boundary. Count registered namespaces and expanded metadata against the heap limit. Reset marked readers after updates and allow failed library setup to retry.
app.executeMenuCommand('Fit Artboard to artwork bounds') threw the
command's error when the active artboard was locked or had no art on
it. The canvas's right-click menu dims Fit to Artwork Bounds then
(DocState::any_art_to_fit), so the script now does nothing and adds
no undo step, as for the other menu items that are not available. The docs state
that an available menu item runs its command and that an error that
command returns throws.
The host-versus-checker name table lists
Application.prototype.executeMenuCommand.
The script host ran its realm with E4X off, so XML literals were syntax
errors and XML, XMLList, Namespace, QName, isXMLName and
setDefaultXMLNamespace were missing from every script, although
vectorcraft-js has them. script.run and File › Scripts now turn E4X on
for .js and .jsx files, script text, #include files, $.evalFile, eval
and Function, and for a #targetengine engine.
script.check lists the e4x and xml features under the language need
instead of hostOnly, since VectorCraft runs them.
A script that called app.redraw() stopped with an error, because app had
no such member. The call now returns undefined and adds no undo step. A
run works on its own copy of the documents, and the app draws the
documents as they were before the run until the run ends, so the call
has nothing new to draw.
A page item's blendingMode gives the object's own blend mode as a
BlendModes value, and assigning one sets it through object.setProps.
The global BlendModes holds the 16 members the scripting constants page
lists; COLORBLEND and SATURATIONBLEND set the Color and Saturation
modes. Any other value throws "blendingMode needs a BlendModes value"
and changes nothing. Assigning the mode the object has adds no undo
step. An object in a hidden or locked layer refuses the change with
"Cannot edit", as opacity does.
New Document's More Settings now shows the columns a preset's rows give
the current artboards, and a new layout or column count replaces those
rows, in the dialog main rewrote.