Wenn per Script ein Formular (oder Musterdokument) geöffnet wird, dann muss man beim Sichern explizit angeben, dass das neue
Dokument
kein Formular sein soll.
Im XPress-Wörterbuch steht:
---
save reference -- the object to save
[in alias] -- the file in which to save the object
[as type class] -- the file type of the document in which to save the data
[template boolean] -- save this document as a template
---
'template' ist der Ausdruck für Formular. Und ein 'boolean' ist meistens entweder 'true' oder 'false'. Auch 'yes' und 'no' wird verwendet.
Wenn man versucht, den Befehl zusammenzustellen...
... dann verwandelt sich das 'template false' in 'without template'. Auch gut. Und es funktioniert. Mit diesem Zusatz wird (ausgehend von
einem Formular) ein Dokument gesichert. Ohne Ergänzung gibt es ein Formular.
Das gilt aber nur für die QuarkXPress-Versionen bis 4.11. Bei der 5.x hilft alles nichts: man erhält immer ein Formular.
Hier ist ein Workaround, welcher den Finder einsetzt, damit das Formular in ein Dokument verwandelt wird:
---
set newPath to ((path to startup disk) as string) & "keinFormular.qxd"
set filePath to (choose file with prompt "Wähle ein Formular" of type "XTMP") as string
tell application "QuarkXPress 5.01"
open filePath as alias
-- weitere Aktionen
save document 1 in newPath
close document 1
my makeTemplate(newPath)
end tell
on makeTemplate(newPath)
tell application "Finder" to set file type of file newPath to "XDOC"
end makeTemplate
---
Der Finder kann den Datei-Typen, welcher beim Sichern auf "XTMP" geblieben ist, auf "XDOC" ändern und somit hat man das gewünschte Dokument.
Hans Haesler, hsa@ringier.ch