Commit Graph
7 Commits
Author SHA1 Message Date
dotCooCoo 9fb8974575 fmt: format the print and save script changes 2026-11-29 14:28:06 -08:00
dotCooCoo e916bef125 Scripts: print and save options follow what the script assigned
- An assigned empty artboardRange prints every artboard instead of the saved range.
- Save and export refuse two destinations that resolve to the same file.
- Script file paths that are not valid UTF-8 are refused.
- PrintJobOptions.file keeps the assigned File, so a later name change is printed to.
- app.open of a template link opens an untitled copy.
- CUSTOMPROFILE with no profile assigned or saved is refused before printing.
- A destination named .ps writes PostScript.
- The save description limits its no-write guarantee to failures found before writing.
2026-11-29 13:42:47 -08:00
dotCooCoo 15ea1ad7f1 Scripts: a panic during print closes the script fence again
Document.print opens the fence for file.print and closes it after the
command returns. A panic in that command skipped the close, so a later
run in the same session could call vc.run('file.print'). The end of
each run slice now clears the marker together with script_in_run.
2026-11-29 10:16:08 -08:00
dotCooCoo a666185cc6 Scripts: fix print, save and export gaps found after merging main
- PrintJobOptions.file reads back as a File that can be assigned again.
- Document.saveAs picks the format from the supplied name before following
  a link, trims the trailing dots and spaces Windows ignores, and keeps the
  .ai, .eps and .pdf rule for a name that is only a dot and an extension.
- A save or export that writes several files refuses a target that is not
  a regular file before any file is written, with the usual path redaction.
- Document.saveAs, Document.exportFile and app.open send command warnings
  to the Script Console.
- fitToPage = false keeps a base tiling mode and clears only a base fit.
- The print scale factors take 1 to 1000 at assignment.
- File and Folder keep their state in native slots, so an object made from
  File.prototype with a path property is refused as before, and logging,
  localize() and toSource() still read their own properties.
- bitmapResolution declares a finite maximum, so its reflection matches.
- The two new script file messages are English only.
2026-11-28 21:21:19 -08:00
dotCooCoo 0830cd1695 Scripts: print writes level 2 PostScript when postScriptLevel is not assigned
A PrintPostScriptOptions object reads postScriptLevel as PSLEVEL2, its
help page's default, but a job written to a .ps file without that
property assigned sent no level to file.print, which wrote level 3.
Document.print now sends level 2 for every PostScript job unless
PSLEVEL3 is assigned.

The print test checks the %%LanguageLevel comment of an unassigned .ps
job (2) and of a job with PSLEVEL3 assigned (3). docs/mcp.md and the
module notes state the default.
2026-11-22 06:51:37 -08:00
dotCooCoo b2d458f667 Scripts: print lists in the host name check, applies range and print area over saved settings
- The host name check lists Document.print as a file write, and app's
  print lists, PrintOptions, its option classes and the printing
  enumerations as names that stay inside the run.
- The script checker reports a file write for print called on a
  document: app.activeDocument, app.documents[i], documents.add(),
  documents.getByName() and app.open(), or a variable that holds one.
  A print method of any other object is not reported.
- An assigned artboardRange without printAllArtboards replaces the saved
  range. An assigned printArea prints by artboard when the saved
  settings, or the preset's, ignore the artboards: the assigned range,
  or each artboard.
- The two scale factors are linked only when they are equal, as
  file.print compares them.
- The format follows the name jobOptions.file gives, also when that
  name is a link to a file with another extension.
- A print option name with a control character at either end throws.
2026-11-21 21:01:41 -08:00
dotCooCoo 1b429b586e Scripts: Document.print prints to a file with PrintOptions and its option classes
Document.print(options) writes the file jobOptions.file names, checked as
saveAs checks its file: PostScript when the name ends with .ps or
postScriptLevel is assigned, a print-ready PDF otherwise. Only the
properties a script assigns are sent to file.print over the document's
saved print settings, which stay as they are, and no undo step is added.
Without a file it throws, since printing to a printer is not available
to scripts yet.

- new PrintOptions() and its nine option classes read as their help
  pages' defaults until assigned, and a PrintOptions holds its option
  objects by reference. Each value is checked when it is assigned.
- Preset, profile and paper names must name an existing preset, an RGB
  or CMYK profile or a known paper; an empty name or one holding a path
  separator or control character throws. An artboardRange naming a
  missing artboard throws before anything is written.
- Options and values that are not mapped throw an error that says they
  are not available yet. printerName and PPDName take only "".
- app.printPresetsList lists the print presets, app.PPDFileList is
  empty, and the print enumerations are published.
- Each warning file.print gives goes to the Script Console.
- vc.run still cannot run file.print or print.*.
- A hosted File given to or returned by a member stays a File.

Help pages: https://ai-scripting.docsforadobe.dev/jsobjref/PrintOptions/
and the option class pages beside it.
2026-11-21 18:31:30 -08:00