Files
vectorcraft/docs
dotCooCoo 55f7dc9205 Scripts: Document.saveAs, Document.exportFile and app.open with option classes
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.
2026-11-21 13:51:09 -08:00
..
2026-11-20 05:45:14 +07:00
2026-11-19 15:12:20 +07:00
2026-11-20 06:07:45 +07:00