Hi everyone
I’m a network admin for a small publishing business, and the guys who use the Macs have a particular problem I need to solve.
Batch converting up to 100 Quark 6.5 files to PDF files, and I’m a complete newbie to AppleScript.
On a PC this could be done very easily but that’s not an option with this since we need the PDF to look exactly like the source Quark file… converting the Quark files to PC Quark, then having the fonts substituted for PC equivalents causes changes in the spacings etc.
The guys in the studio are using a variety of OSX versions, some Panther, some Tiger.
I believe the OSX Automator only appeared with Tiger, though I am probably wrong as I’m not in the world of Macs.
But for this task, we can just use the same machine every time so if it can only be done on Tiger then we’ll just always run it on that particular Mac.
Each issue of the magazine lives in a separate folder on our NAS.
Then each page or spread is in it’s own sub-folder along with the original word/text docs and all the images for that page/spread.
I’m guessing it’ll be difficult to access the NAS through AppleScript, so if necessary I can copy the issue folder from the NAS onto the OSX desktop. Then the script just runs through the local copy.
Here was my theory of how the script would run…
- Search through the magazine issue folder and return all Quark files from any subfolders.
- Loop through each Quark document in the search results, opening it and running a particular menu/shortcut or menu option, close the Quark document
Right now I’m only concerned about part 1.
Once I’ve got that working I will worry about how Quark actually outputs the PDF, there are a few different options available for that.
So for the time being, all I want to achieve is to get Quark to open then close that Quark document… then move on to the next file in the results.
Is there a way to automate a search, return all files of a particular document type, then loop through each one of the search results?
With a PC this bit is easy since all documents of a certain type, have the same file extension.
But the quark files created by the Macs have no such file extension… although it can be enabled if necessary… but I’d like to find a way of doing it without relying on our Mac designers remembering to add the file extension.
Does anyone have any AppleScript snippets that I can look through on how to script a file search?
Is there a reference of all the built in OSX AppleScript actions / functions?
I’ve just started messing around with the AppleScript Script Editor… I guess that’s the right place to start writing the script?
Here’s what I’ve managed to get so far…
-- SPECIFY FOLDER TO START THE SEARCH
set SourceFolder to (choose folder with prompt "Select the folder containing the Quark documents") as text
-- SPECIFY FOLDER FOR PDF OUTPUT
set OutputFolder to (choose folder with prompt "Select the folder where the PDFs will be saved") as text
-- DO SEARCH FOR ALL QUARK DOCS UNDER SourceFolder
-- LOOP THROUGH EACH SEARCH RESULT
-- MAYBE A WAY TO GET ALL THE SUB-FOLDER NAME AND FILE NAMES INTO A BIG ARRAY
tell application "QuarkXPress Passport"
activate
open
-- OUTPUT AS PDF STUFF IN HERE
close
end tell
Here’s the specs of the system I’m using to develop this script:
AppleScript 1.10.7
Script Editor 2.1.1 (81)
OSX 10.4.10
Dual 2 GHz PowerPC G5, 1.5GB DDR2 SDRAM
And the version of Quark is 6.5 Passport
Thanks
Ben