If anyone could point me in the direction of resolving the following problem I would be extremely grateful.
Briefly, I’ve created a new XPress file from a template (with input via avenue.quark, controlled by prefab player), and I now want to save the file, so I have the following
--snippet 1
set theXPressSave to (theXPressOutFolder & theXPressName & ".xpr") as string
save document 1 in theXPressSave without template
close document 1 saving no
Looks simple enough, but XPress throws up “QuarkXPress™ got an error: can’t make some data into the expected type”. Logically enough I assume the variable “theXPressSave” is wrong somehow, but various debugging shows that not to be the case.
Trying to work through the problem I come up with:
--snippet 2
set theXPressSave to (theXPressOutFolder & theXPressName & ".xpr") as string
set the clipboard to theXPressSave
save document 1 in (the clipboard as string) without template
close document 1 saving no
Which, unbelievably, does work.
If I hard code “theXPressSave” as a string it also works - but this is no good to me because I’m processing lots of files at the same time.
Snippet 1 does work if the file “theXPressSave” already exists - ie it will overwrite an existing file. Variation on:
save document 1 in (theXPressSave as string) without template
appear not to work either.
TIA
– Clive