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)