Access OS X Mail message by its ID I am trying (unsuccessfully) to get a Mail message (located in the 'Drafts' folder) by its message id.

The following code:

set theContent to getContent(123456)

on getContent(theID)

  tell application "Mail"       
    try
      return ((content of message whose message id is theID) as rich text)
    on error errText number errNum
      display dialog "Error: " &amp; errNum &amp; return &amp; errText
    end try

  end tell

end getContent


Generates an error that reads: Error -1723.  Can't get the content of message whose message id = 123456.  Access not allowed.

What am I missing?
Try:

tell application "Mail" to get content of (first message of drafts mailbox whose id = 123456)