- A process swatch that holds an RGB color in a CMYK document (made
with keepModel, as a color theme's swatches are) records no undo step
when a script assigns it that color again. swatch.edit keeps a
swatch's own color as it is, so the assignment changed nothing.
- Assigning a SpotColor whose spot is unset, or one read from a global
process swatch, throws "SpotColor.spot must be a Spot; a color read
from a global process swatch cannot be assigned yet". The SpotColor
page (https://ai-scripting.docsforadobe.dev/jsobjref/SpotColor/)
requires spot. The path keeps its paint.
- docs/mcp.md now says that a SpotColor cannot be assigned to a
swatch's or spot's color yet; a path's fillColor and strokeColor take
one.
- A fill or stroke linked to a global process swatch reads as a
SpotColor without a spot. That color does not name its swatch, so
assigning it to any fill or stroke throws an error that says it is
not available yet, and the path keeps its paint.
- A spot's color, set through Spot.color or Swatch.color, keeps an
RGBColor in a CMYK document as RGB, as it keeps a CMYKColor in an RGB
document, and assigning the color it has again records no undo step.
A process swatch's Swatch.color still stores an RGBColor in a CMYK
document as CMYK, and assigning that RGBColor again records no step.
- docs/mcp.md and the module notes state that a spot keeping a color of
the other color space is VectorCraft's own rule: the Spot page
(https://ai-scripting.docsforadobe.dev/jsobjref/Spot/) says a color in
another space than the document's gives an error, and spots.add()
converts the fill to the document's space as that page asks. They
also state VectorCraft's own SpotColor tint defaults: 100 from
new SpotColor(), 0 for a color object without a tint.
- Tests cover a path painted with Registration through a SpotColor, a
SpotColor without a tint, and spot and process swatch colors in a
CMYK document.
Docs: docs/mcp.md.
- Assigning a SpotColor to a path's fillColor or strokeColor links the
paint to its spot at its tint with paint.setFill or paint.setStroke
(https://ai-scripting.docsforadobe.dev/jsobjref/SpotColor/). The spot
must be a Spot of the path's document, and the tint runs from 0 to
100. Reading the paint back gives the SpotColor with its spot, so
assigning it again records no undo step.
- Spot.color takes an RGBColor, a CMYKColor or a LabColor in a document
of either color space, and the spot keeps that color space, as the
Swatches panel's spots do. A GrayColor still throws.
- doc.spots lists Registration, whose colorType reads
ColorModel.REGISTRATION and which cannot be renamed, recolored or
removed; removeAll() keeps it. Registration's swatch color reads as a
SpotColor of it.
Docs: docs/mcp.md, docs/target-app-parity.md.
A preset made with file.new's rows under gridByColumn shows the column
count those rows give the current number of artboards. Changing the
Layout field removed the rows and kept the preset's stored columns, so
Create laid out a different number of columns than the dialog showed.
The layout change now writes the shown count into columns, for rows
stored as integers or floats. Under gridByRow the dialog shows the
stored columns and file.new rejects rows, so a layout change from it
keeps the stored columns, as it does for rows file.new would reject.
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.
The dialog read artboardLayout's rows and columns as whole numbers only,
so a value stored as a float (4.0 from ui.dialog.set) fell back to the
stored columns while file.new made the grid from it. The dialog now reads
both as file.new does: a number of 1 or more, rounded and kept to the
artboard limit.
- After each vc.run, the check that leaves removed swatches, symbols,
styles and brushes stale visits only the documents that changed since
the last check, and the slots and names it compares are charged to the
run.
- SymbolItems charges the page items it scans for symbol instances, as
pageItems.getByName does.
- ROADMAP's M13 row lists the swatches, spots, color groups, symbols,
graphic styles and brushes scripts now have.
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.
- 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.
Each document gains the swatches, spots, swatchGroups, symbols,
symbolItems, graphicStyles and brushes collections that the scripting
reference lists (https://ai-scripting.docsforadobe.dev/jsobjref/Document/).
Each change runs the existing Swatches, Symbols, Graphic Styles or
Brushes command inside the run's transaction.
- Resource objects follow renames made through them and throw
Stale <Class> once the resource is removed, or renamed or deleted
with vc.run, so a new resource with the old name is not theirs.
- Swatches, spots and color groups share their names: a name one of
them already has throws instead of taking a numbered name.
- None, Registration and the Default Graphic Style cannot be renamed
or removed, and removeAll() keeps them.
- spots.add() converts the current fill to the document's color space
unless it is Lab; a spot's color stays in that space or Lab.
- A tint of a spot reads as a SpotColor of that spot at its tint.
- Brush.applyTo throws for a guide, a clipping path and a path in a
compound path, which brush.apply does not brush.
- Objects of another document throw before any command runs.
- Document.gradients, Document.patterns and assigning a SpotColor to
art are not available yet.
The host name check lists the new classes, members and enumerations.
Docs: docs/mcp.md, docs/target-app-parity.md.
- Changes to a path's points (closed, setEntirePath, pathPoints and each
PathPoint) wait in the object model and are written by one
path.setAnchors before any other member or command, before another
path's points change, and when the script ends. A loop over 2,000
points now runs one command and makes one undo step. A path aligned to
the pixel grid is written at each change so its points read snapped.
- A color component reads with the fewest decimals, at least 4, that give
the stored value back, so assigning a color read from a path leaves the
path unchanged (RGB, CMYK, Gray and Lab, fill and stroke).
- add() and the shape creators put the new path on top of the active
layer whatever the drawing mode, and leave the mode as it was.
- fillOverprint and strokeOverprint change the top fill or stroke only.
- filled = true on a compound path member places the new-art gradient on
the compound path's bounds.
- An identity rotate or resize checks its arguments and runs no command,
on an empty path too.
- Tests for each of these, and for setAnchors reading smooth false as a
corner.
Docs: docs/mcp.md, docs/gaps.md, docs/roadmap.md,
docs/target-app-parity.md.
* svg: cut over CSS transform, CSS string quoting, and symbol unit basis to craft-svg (#789)
* build: repin craft-svg to merged craft-libs main (d20a8248)
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.
A rotated rectangle given a width and then a height through the scripting object model reads back the values set, its geometric bounds have that size, and other objects stay as they were. The resize doc comment names the page's axes.
artboardSpacing is refused above 100,000 points, the limit file.new
applies, so a value file.new would refuse throws a RangeError that names
artboardSpacing.
When an edit puts the selection back, the Layers panel target, symbol part,
Objects on Path member, ruler guide and key object commands fall back or
skip only when the command refuses with an ordinary error. An internal
failure or a request to stop now ends the run instead of being treated as
a refusal.
Document.pathItems lists a document's paths and makes empty paths,
rectangles, rounded rectangles, ellipses, polygons and stars with the
parameter order and defaults of the PathItems help page. A PathItem
reads and changes its points, closed state, fill rule, area, length,
fill and stroke colors, stroke options and overprint, and translates,
rotates and resizes. PathPoints and PathPoint read and set each
point's anchor, handles and type. RGBColor, CMYKColor, GrayColor,
LabColor and NoColor make colors; a gradient, spot or pattern paint
reads as GradientColor, SpotColor or PatternColor.
Each change runs an existing command (path.create, the shape.*
commands, path.setAnchors, path.close, path.setFillRule,
paint.setFill, paint.setStroke, stroke.set, object.setOverprint,
object.move, object.rotate, object.scale) inside the run's one undo
step, and puts back the selection and the paint for new art. A value
that changes nothing runs no command; a bad value throws and changes
nothing.
path.setAnchors now makes an anchor a corner when it is given
`smooth: false`; before, the key was ignored and handles in line made
it smooth.
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.
- An edit a script makes puts back a Layers panel target, an object
chosen inside a dynamic symbol instance and an object chosen in an
Objects on Path group, each with its own selection command.
- Assigning a document's selection selects a symbol instance or an
Objects on Path group as a whole when one of its objects was chosen.
- file.newPresets lists a grid by column's rows as set, also when there
are fewer artboards than rows, and New Document's Columns shows the
columns those rows give the current number of artboards.
- docs/roadmap.md's M13 row names the script object model that is
available.
- duplicate() runs Edit > Duplicate, the place and the selection
restore under one savepoint, so a refused place leaves the documents,
the selection and the undo history as they were. It reads the copy's
id from the command's own result, so ids above 2^53 return the copy.
A path inside a compound path throws an error instead of copying the
whole compound path.
- An edit restores a mixed selection (direct-selected anchors and whole
objects) in its original order with one select.anchorsMany.
- Assigning the selection clears a Layers panel target.
- A call on an inactive document switches back even when the selection
restore fails.
- documents.add with a grid by column passes the row count to file.new,
which takes a new artboardLayout.rows key: 5 artboards in 4 rows give
columns of 4 and 1. A preset keeps the rows until columns without
rows, or another layout, is given, and New Document drops them when
Columns or the layout changes.
- A held page item stays the same object when its class changes in the
same family (a placed image that is embedded becomes a RasterItem).
- A waiting class member's answer is read as a class instance, and a
class constructor called with new cannot wait.
Docs: docs/mcp.md (DocumentPreset, duplicate, file.new rows), docs/gaps.md
(G6).
Scripts get an app object with its documents, the active document and its
selection, and the page items of a document, read and edited through
commands so each edit is one undo step and is journaled. Host classes in
the JavaScript engine give each document or item one object while a script
holds it, answer `in` and indexed reads, and throw on stale objects and on
members that are not available yet.
Docs: docs/mcp.md, docs/target-app-parity.md.