• 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: Referencing a Message in Mail 6.1 - Huh?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Referencing a Message in Mail 6.1 - Huh?


  • Subject: Re: Referencing a Message in Mail 6.1 - Huh?
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 03 Oct 2012 08:53:39 +1000

On 03/10/2012, at 8:08 AM, Ron Hunsinger <email@hidden> wrote:

No. The problem is that Mail's dictionary defines "message id" as a property of a message. Something as simple as

tell application "Mail"
get source of message id 1
end tell

parses "message id" as a single token, and then doesn't know what to do with the following number. You get a syntax error. It doesn't matter whether there is a message whose id is 1, nor whether Mail can locate the message by just its id, because the syntax error prevents the script from ever running.

That was my initial thought, but I don't think it's the real problem. Enter the following with suitable id and mailbox name:

tell application id "com.apple.mail" -- Mail.app
message «class ID  » 204357 of mailbox "Anna scripting"
end tell

When you compile it (once), you will get:

tell application id "com.apple.mail" -- Mail.app
message id 204357 of mailbox "Anna scripting"
end tell

Notice the different styling of message and id. Yet the script still fails.


-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

  • Follow-Ups:
    • Re: Referencing a Message in Mail 6.1 - Huh?
      • From: Stan Cleveland <email@hidden>
References: 
 >Referencing a Message in Mail 6.1 - Huh? (From: Christopher Stone <email@hidden>)
 >Re: Referencing a Message in Mail 6.1 - Huh? (From: Axel Luttgens <email@hidden>)
 >Re: Referencing a Message in Mail 6.1 - Huh? (From: Shane Stanley <email@hidden>)
 >Re: Referencing a Message in Mail 6.1 - Huh? (From: Ron Hunsinger <email@hidden>)

  • Prev by Date: Re: regex in Satimage OSAX doesn't work the way I expected
  • Next by Date: Re: Referencing a Message in Mail 6.1 - Huh?
  • Previous by thread: Re: Referencing a Message in Mail 6.1 - Huh?
  • Next by thread: Re: Referencing a Message in Mail 6.1 - Huh?
  • Index(es):
    • Date
    • Thread