Printing from mail.app with UI scripting
Printing from mail.app with UI scripting
- Subject: Printing from mail.app with UI scripting
- From: Jacco Rens <email@hidden>
- Date: Thu, 5 Aug 2010 09:06:26 +0200
Hello All,
I have the need for printing certain messages via a rule from within Mail.app.
Those messages are html formed, and need to be printed as seen (command + P). I tried writing a script that does this, but it fails because when run automatically, it has no message selected to invoke the command + p action. What I'm looking for, as an addition to this script, that opens the message in a new window, and then prints it. If we could add an file message action to it, that would be awesome.
Google gave me so far only plaintext printing solutions.
Script so far:
on perform_mail_action(theData)
tell application "Mail"
set theSelectedMessages to |SelectedMessages| of theData
set theRule to |Rule| of theData
repeat with a from 1 to count theSelectedMessages
tell application "Mail" to activate
-- open the item a of theSelectedMessages, need help here
tell application "System Events"
tell process "mail"
keystroke "p" using command down
keystroke return
end tell
end tell
-- file item a of theSelectedMessages to sub folder called "orders"
end repeat
end tell
end perform_mail_action
Thanks for your insights!!
--
jacco _______________________________________________
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