print command after 10.14 does not accept printer name
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