Is there anyway to suppress the print dialog box when issuing a print command in applescript? I have modified a folder action script to print any items added to a folder, now I don’t want to have to deal with the dialog box.
From Applescript-Users: Date: Thu, 13 Apr 2000 11:10:17 -0500
From: “Ramona Reeves” Subject: Re: Scripting Prints with no dialog
I would interested to see if someone comes up with a better solution, but I haven’t had much luck scripting actual print/page setup settings. What I have been able to do is, set up my printer/printers the way I want them and choose the “save settings dialog” to save my configurations to my desktopprinters.Then I use a script like below to call the printers, depending on what the doc calls for–color or b&w. The dialog still comes up, but by using Sandi’s Additions, I can dismiss it without the need for any user interaction.
on idle set defPrint to "Dispatch LaserJet 4050" tell application "Finder" activate set printFolder to folder "PrintMe" of startup disk set docsToPrint to (files of printFolder) select item defPrint end tell TypeText "L" with Command --Sandi's Addition repeat with i in docsToPrint print i end repeat set aReturn to ((ASCII character 13) as string) --because "Return" doesn't seem to work TypeText aReturn end idle
Date: Fri, 14 Apr 2000 14:08:16 +0100
From: “Bryan Fernandez” email@example.com
Subject: Re: Scripting Prints with no dialog
Thanks for the last post, it was very helpful. I looked at Sandi’s Additions but unfortunately Acrobat Reader (my PDF viewer and printer) does not let Sandi’s Additions type in the dialog.
I have been looking around and I have found a control panel called ‘Okey Dokey Pro’. It causes the default button to be pressed after a specified time on a dialog that appears. You can limit it to specific applications too. Unfortunately I can’t specify the number of pages like this so I would have to loop for each page. This becomes very messy as Acrobat Reader is not scriptable and I have to open the file for each print then it closes it afterwards.
And if you already own QuicKeys or One Click, I’m sure either of them can be called upon to dismiss dialog boxes, too.
One more thing: I haven’t checked, but the Applescript Guidebook on scripting Desktop Printers may have a solution.