Quark to PDF

Hi,

I’m looking for a script that will will take all the Quark 7 files in a folder and convert them to low res pdfs for proofing purposes. Does anyone have a script like this or something I can work from?

Thanks in advance.

Model: G5
AppleScript: 2.1.1
Browser: Firefox 2.0.0.6
Operating System: Mac OS X (10.4)

Moved to OS X

Hi,

I can suggest you what you can do it. We people can do it, but every one is with their own projects. Set your default printer as Adobe PDF or PostScript printer.

If you are using PostScript printer then create an applescript to open each files one by one and fire print on the default printer and save those PS in a hot folder. Hot folder will create PDFs.
If you are using Adobe PDF printer then do your printer settings and through applescript you can open and print those quark files in any target folder.

Thanks
Rajeev

Thanks for the idea.

Does anyone have an example script that I could work from? New to this and I usually can figure things out working from an example.

Thanks!

Hi,

Which type of example you want. Just try googling you will find so many free ware scripts.

Thanks

Hi Durango

Have a play around with this:

tell application "Printer Setup Utility"
	launch
	set mylaserprinter to "Adobe PDF 7.0" -- Printer name
	set current printer to first printer whose name is mylaserprinter
	--quit
end tell
tell application "QuarkXPress"
	activate
	set dn to name of document 1
	tell document 1
		repeat with i from 1 to count of pages
			set filePath to (path to desktop folder) & dn & " Pg " & i & ".ps" as string
			tell print setup
				set printer type to "AdobePDF 7.0"
				set paper size to "Custom"
				set fit in area to true
			end tell
			print PostScript file filePath
		end repeat
	end tell
end tell

This is gonna save a postscript file to your desktop which you can throw on distiller. you can easily change it to point to a watched folder.
the only other way i know of creating a pdf in quark is using the GUI which can be a bit flakey!
But this should point you in the right direction.

Thanks everyone! I’ll give this a try.

This is good code for printing to PDF.
I am posing, what if I have an output style (that’s what Quark calls presets) for PDF export and want to script that pathway out to PDF, how does anyone call that out?

Thanks!

Hi T_Rex

i guess you would still have to open the print dialog window to print so you would need GUI scripting to click buttons which is not ideal!!
i don’t have access to quark at the minute so i don’t know if you can call print presets you might be able to i know you can do it in apps like illustrator so maybe!!

How would one go about telling the script to skip a file if it get’s an error? For example…let’s say the file is corrupt and I want it to skipt that file and go onto the next in a sequence. Is this possible?

Thanks!

Hi

I guess you would have to Trap the error in a “try- on error- block”
depends on what the problem with the file is i suspect.
a bit of testing involved i would imagine would be needed!!

HI ALL,

I am trying to develop script to generate PS of files. Please see the below code and suggest me where I am doing mistake. I am not able to get the file name of the current document. May be some expert can help me out.


tell application "Printer Setup Utility"
	launch
	set mylaserprinter to "Adobe PDF 8.0" -- Printer name
	set current printer to first printer whose name is mylaserprinter
end tell
set source_folder to choose folder with prompt "Select folder containing QuarkXPress Documents"
set Output_folder to choose folder with prompt "Select folder to print PostScript to"
tell application "Finder" to set item_list to every item of source_folder


repeat with this_item in item_list
	tell application "QuarkXPress"
		open this_item use doc prefs yes remap fonts no do auto picture import no with reflow
		set Doc_Name to name of the front document
		set PS_filename to characters 1 thru -6 of Doc_Name & ".ps" as string
		set PS_Path to (Output_folder as string) & PS_filename
		
		tell print setup
			set printer type to "AdobePDF 8.0"
		end tell
		print PostScript file PS_filename
		close document 1 saving no --> or yes depending on personal preference
		
	end tell
end repeat

Thanks
Macrajeev

Hi All,

I am using the below script to generate the postscript file. But here I am facing problem of layout size. How can I set page height & page width of the document while printing.

So many files having different page size & page setup. But when it print to postscript the properties get changed.


property Quark_Types : {"XPRJ", "XDOC"}
set Input_Folder to choose folder with prompt "Choose folder has quark files" without invisibles
set Output_folder to choose folder with prompt "Choose folder where you want to create PS" with invisibles
tell application "Finder" to set item_list to every file of Input_Folder
tell application "QuarkXPress"
	repeat with this_item in item_list
		open the file (this_item as string) use doc prefs yes remap fonts no do auto picture import yes without reflow
		set Doc_Name to name of the front document
		set PS_Path to (Output_folder as string) & Doc_Name & ".ps" as string
		tell application "QuarkXPress"
			activate
			tell document 1
set PH to page height
set PW to page width
				print PostScript file PS_Path
				delay 5
				close saving no
			end tell
		end tell
	end repeat
end tell


Also I am getting some dialog box if fonts are corrupted or images are missing. I want to print postscript file without concern of corrupted fonts or missing images.

Thanks
Pooja