Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get .emlx file for Mail message?




On 23 Sep 2006, at 15:27, Michael Grant wrote:

Is there any way, in AppleScript or otherwise, to quickly identify the
.emlx file corresponding to a given message in Mail?

What I'm trying to do is create text "bookmarks" to specific messages
in the form of file:// URIs, which I would then be able to place in
any app that processes text.

I'd try something like this, Michael:

----------------

on file_location for m
tell application "Mail" to tell m's mailbox
set n to name
set p to ".mbox/Messages/"
tell its account to if exists then
if account type is not pop then set p to ".imapmbox/Messages/"
return account directory & "/" & n & p & m's id & ".emlx" as POSIX file
end if
set p to n & p
set c to its container
repeat while c exists
set p to c's name & "/" & p
set c to c's container
end repeat
end tell
POSIX path of (path to library folder from user domain) & ¬
"Mail/Mailboxes/" & p & m's id & ".emlx" as POSIX file
end file_location


tell application "Mail" to set msg_ref to (get selection)'s item 1
tell application "Finder" to set msg_URL to URL of my (file_location for msg_ref)


(* do something with msg_URL *)

----------------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Get .emlx file for Mail message? (From: "Michael Grant" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.