• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Setting default printer request.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting default printer request.


  • Subject: Re: Setting default printer request.
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 10 Jun 2015 19:47:47 +1000

G’day scripters

Just to keep everyone up to date, and in the hope that someone might have the answer to this, I’ve also been posting on the Graphicconverter Yahoo Groups forum.

I’ve managed to define the default printer, but when I try and print direct from GraphicConverter, with the show print dialog set to no, the item prints, but from the first printer in the System Preferences printer list, not the default.

If I set the show print dialog to yes, the print dialog freezes, and only responds to physical clicks, and is not scriptable.

Does anyone perhaps know of a way of getting the print dialog box not to freeze?

Regards

Santa

property theLargePagePrinter : "Large Page Printer"
property theSmallPagePrinter : "A4 Printer"

# Presume the default printer is set to 'A4 Printer'

set printerName to ""
set p to 2
set tempPrinterName to my theLargePagePrinter as text
set p to 3
repeat with x from 1 to (count of tempPrinterName)
if character x of my tempPrinterName is not " " then
set printerName to printerName & (character x of tempPrinterName) as text
else
set printerName to printerName & "_" as text
end if
end repeat
set defaultPrinterProperties to do shell script ("lpoptions -d " & printerName)

try
tell application "GraphicConverter 9"
activate
# Using 'print dialog no' doesn't work, still uses first listed printer
# Using 'print dialog yes', chooses correct printer, but printer sheet freezes unless 'Print' is physically clicked, and clicking 'Cancel' gives a 'GraphicConverter 9 got an error:AppleEvent handler failed' error

print document 1 print dialog yes
print document 1 with properties {target printer:(theLargePagePrinter)} print dialog yes

  say 1
activate
tell application "System Events" to tell process "GraphicConverter 9"
keystroke return
end tell
end tell
on error errmsg
display dialog errmsg
end try
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Setting default printer request. (From: Brian Christmas <email@hidden>)
 >Re: Setting default printer request. (From: Luther Fuller <email@hidden>)
 >Re: Setting default printer request. (From: Brian Christmas <email@hidden>)

  • Prev by Date: Select a mail template/sjabloon
  • Next by Date: Re: Select a mail template/sjabloon
  • Previous by thread: Re: Setting default printer request.
  • Next by thread: Re: Re: Setting default printer request.
  • Index(es):
    • Date
    • Thread