• 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
Re: Printing from mail.app with UI scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing from mail.app with UI scripting


  • Subject: Re: Printing from mail.app with UI scripting
  • From: Philip Aker <email@hidden>
  • Date: Thu, 5 Aug 2010 08:35:32 -0700

On 2010-08-05, at 00:06:26, Jacco Rens wrote:

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.

Here's one step further:

using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
        tell application "Mail"
            repeat with mess in theMessages
                set subj to subject of mess
                try
                    tell message viewer 1 to open mess
                    delay 1
                    tell application "System Events" to keystroke "p" using {command down}
                on error errs number errn
                    display dialog "Problem with message " buttons {"OK"} default button "OK" with icon stop
                end try
            end repeat
        end tell
    end perform mail action with messages
end using terms from



Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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

References: 
 >Printing from mail.app with UI scripting (From: Jacco Rens <email@hidden>)

  • Prev by Date: Re: How to change starting page number in InDesign
  • Next by Date: Re: Search and replace with Unix commands
  • Previous by thread: Printing from mail.app with UI scripting
  • Next by thread: How to change starting page number in InDesign
  • Index(es):
    • Date
    • Thread