Properties for Finder Print


(Gary Reimer) #1

I am very new to AppleScript. Script Debugger is a huge help. I wrote a short script used to print a pdf. The script is generated from within FileMaker to print work orders as they are generated and it works. But now I discovered that I need to specify the printer and the preset for that printer. I am assuming that the properties would be a place to make the specification, but I have no idea how. Could someone give me some advice?

The appleScript that FileMaker generates results in the following form:
Tell application "Finder"
print document file “WorkOrderPrint-#133094.pdf” of folder “WO” of folder “Desktop” of home
end tell

How would I add properties to specify the printer and the printer preset?

Thanks
Gary


(Nigel Garvey) #2

Hi.

The Finder’s own dictionary’s silent on this. Presumably it calls the application which owns the file to do the printing and would therefore have to send print settings that the application understood. On the other hand, many print settings are printer specific and the print settings properties in all the dictionaries I’ve looked at seem to be a standard set of basics:

copies (integer) : the number of copies of a document to be printed
collating (boolean) : Should printed copies be collated?
starting page (integer) : the first page of the document to be printed
ending page (integer) : the last page of the document to be printed
pages across (integer) : number of logical pages laid across a physical page
pages down (integer) : number of logical pages laid out down a physical page
requested print time (date) : the time at which the desktop printer should print the document
error handling (standard/‌detailed) : how errors are handled
fax number (text) : for fax number
target printer (text) : for target printer

So using a particular printer is easy:

tell application "Finder"
	print document file “WorkOrderPrint-#133094.pdf” of folder “WO” of folder “Desktop” of home with properties {target printer:"Your printer's name here"} -- Substitute the name of the printer as seen in a "Print…" dialog.
end tell

But a “printer preset” sounds printer-specific to me. I don’t know if it would be scriptable.