Skip to content

Instantly share code, notes, and snippets.

@kcarnold
Created November 12, 2019 22:37
Show Gist options
  • Save kcarnold/40e62cacf0fbcc1debf24e5f27c52e8b to your computer and use it in GitHub Desktop.
Save kcarnold/40e62cacf0fbcc1debf24e5f27c52e8b to your computer and use it in GitHub Desktop.
AppleScript to email a PDF to the Calvin University print queue (use with "Run AppleScript" action in Automator, in either a Print Plugin or a Quick Action)
on run {input, parameters}
set PDFs to input
set msubject to "to print: "
repeat with aFile in PDFs
tell application "Finder"
set filename to ((name of aFile) as string)
end tell
set msubject to msubject & filename & ","
end repeat
tell application "Microsoft Outlook"
set newMessage to make new outgoing message with properties {subject:msubject}
make new recipient at newMessage with properties {email address:{address:"[email protected]"}}
tell newMessage
repeat with aFile in PDFs
make new attachment with properties {file:aFile}
end repeat
end tell
open newMessage
get newMessage
activate
end tell
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment