• 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
How can I get real printer name, please?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I get real printer name, please?


  • Subject: How can I get real printer name, please?
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 08 Jun 2015 17:20:36 +1000

G’day scripters

I’m having problems using the GUI to print QuarkXPress documents reliably (version 10.6.1)

I’d like to use the direct print approach, but need to know the actual name of the nominated printer to do so. This nominated printer will be different on different machines, but will have an assigned System Preferences name.

If, for example, the assigned name is “Large Page Printer”, and this is stored in the variable ‘largePagePrinter’, which actually refers to an HP LaserJet 200 color M251, which is listed in the following code, how do I get the real printer name from the variable?

HP LaserJet 1320 series

HP LaserJet 200 color M251

HP LaserJet 200 color MFP M275


TIA

Regards

Santa



property largePagePrinter : "Large Page Printer"

tell application "QuarkXPress"
activate
set temp2 to ""
tell document 1
tell print setup
set temp to printer type list
set theList to {}
repeat with x from 1 to (count of items of temp)
set temp2 to (item x of temp) as text
set end of theList to temp2 & return as text
end repeat
end tell
try
tell application "Finder"
set theFileName to ((path to desktop) & "The List" as text)
set fRef to (open for access file theFileName with write permission)
set eof fRef to 0
try
repeat with x from 1 to number of items in theList
write item x of theList & return to fRef
end repeat
end try
close access fRef
end tell
on error
try
close access fRef
end try
end try
print #print output style (my largePagePrinter)
end tell
end tell



 _______________________________________________
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

  • Prev by Date: Re: numbers in words
  • Next by Date: Confused by the add library event in Smile.
  • Previous by thread: Re: numbers in words
  • Next by thread: Confused by the add library event in Smile.
  • Index(es):
    • Date
    • Thread