• 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
print command after 10.14 does not accept printer name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

print command after 10.14 does not accept printer name


  • Subject: print command after 10.14 does not accept printer name
  • From: Takaaki Naganoya via AppleScript-Users <email@hidden>
  • Date: Fri, 29 Jan 2021 12:35:43 +0900

Hi All,

In macOS 10.12, I ensured print command accepts printer names.
Now I re-checked the same script and found print command does not accept
printer name.
macOS 10.14.6, 10.15.7 and 11.x seems to ignore printer names.

How about this?

<AppleScript>
-- Created 2014-11-27  by Takaaki Naganoya
-- 2014 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"

set pArray to current application's NSPrinter's printerNames
set pList to pArray as list
--> {"KING JIM TEPRA PRO SR3700P", "NEC MultiWriter 5750C", "PDFwriter",
"PM-T960-1"}



tell application "Safari"
        activate
        set aPrinter to first item of (choose from list pList with prompt
"Select Printer")
        tell front document
                set aPrintSetting to {copies:1, target printer:aPrinter}
                try
                        print with properties aPrintSetting with print dialog
                on error
                        return "Error"
                end try
        end tell
end tell
</AppleScript>

--
Takaaki Naganoya
email@hidden
http://piyocast.com/as/



 _______________________________________________
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: New memeber
  • Next by Date: Re: Testing
  • Previous by thread: Re: New memeber
  • Next by thread: Man entry to pdf variant command
  • Index(es):
    • Date
    • Thread