• 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: Simple apple script to open a message in Mail?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple apple script to open a message in Mail?


  • Subject: Re: Simple apple script to open a message in Mail?
  • From: Deivy Petrescu <email@hidden>
  • Date: Sat, 23 Feb 2013 09:42:23 -0500

On Feb 22, 2013, at 16:04 , Bruce Herbach <email@hidden> wrote:

> Nigel, Doug,
>
> Thanks for the suggestions.  The developer of the import software gave me this piece of Applescript that seems to work.
>
> First add "message:<" to the beginning of the ID and ">" to the end of the ID.  Then use this script
>
> tell application "Mail"
>    open location "message:"
> end tell
>
> This seems to work and it is very easy to get FileMaker to add the required text to the message ID.  This method avoids having to open the mailbox and the search for the message id that were failing.
>
> Bruce Herbach
> Herbach Consulting
> FileMaker 12,11,10,9 Certified Developer
> _______________________________________________

Bruce,
Thanks for posting the solution.
I thought it was weird to have an "open location" inside a "tell app Mail".
So I went ahead and tried the following

<script>
tell application "Mail" to tell message viewer 1 to set mid to message id of its message 1
open location "message:<" & mid & ">"
</script>

This works every time.
This means that if your message id is saved together with the message, "open location" would use Mail (I assume the default mail client in general) to open the URL passed to it because it contains the word message.
The" tell app mail" part is not necessary.
I tried substituting "<" and ">" by "<" and ">" respectively but it does not work.

Summarizing  open location "message:<" & mid & ">" is all you need.


Deivy Petrescu
email@hidden




 _______________________________________________
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: 
 >Re: Simple apple script to open a message in Mail? (From: Bruce Herbach <email@hidden>)

  • Prev by Date: Re: Simple apple script to open a message in Mail?
  • Next by Date: Re: Simple apple script to open a message in Mail?
  • Previous by thread: Re: Simple apple script to open a message in Mail?
  • Next by thread: Re: Simple apple script to open a message in Mail?
  • Index(es):
    • Date
    • Thread