Scripting QuarkXpress—Open/Close

Mac OS, 10.3.9, AppleScript 1.9.3\Script Editor 2.0 (v43)

Client wants to convert previous Quark docs to Quark 6. I was easily able to change the file type to “XPRJ.” Client does not like this approach; insists he needs the script to open a found file, then save it to the same folder as version 6.

I have a core that roots thru a master folder and all subfolders.

set myFiles to files of (entire contents of folder chosenFolder) whose file type = “XDOC”
This selects only Quark files (if there is a better way, kindly let me know; sometimes AppleScript issues “can’t make some data into expected type”).

The next bit does the work; even with “doc prefs yes,” splash screen still comes up for some files

on finderprocess(myFiles)
repeat with theItem in myFiles
tell application “QuarkXPress”
open theItem use doc prefs yes remap fonts no do auto picture import no
end tell
end repeat
end finderprocess

I manage to open files. I cannot close with save. I have tried

close front window saving yes
close open doc

Almost there (sort of). Suggestions, anyone?

Thank you.

Since the document is converted from an older version you will need to use the save command to save the file, Quark does not keep the “link” to the old file when the conversion takes place, it recognizes it as a new document.

You may also want to open the files with the “alt/option” key held down as this will rebuild the files to a type 6 creator which is safer than resaving type 3, 4 & 5 types as 6. Although I couldn’t tell you how to script this part. You can check the version types when going to file and open.