• 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: Get .emlx file for Mail message?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get .emlx file for Mail message?


  • Subject: Re: Get .emlx file for Mail message?
  • From: John M <email@hidden>
  • Date: Sat, 23 Sep 2006 19:06:34 +0100

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

Yes,

This script uses Mail to get the message 'id', does a 'spotlight' search using mdfind against the id, then url encodes the resulting file path. The mdfind script is a bit slow though (taking about 5 seconds on my machine).

Select a message in Mail then run this script:

--
tell application "Mail"
set myID to id of (first item of (get selection))
set myFile to paragraph 1 of (do shell script "mdfind \"kMDItemFSName == " & myID & ".emlx && kMDItemKind == 'emlx'\"")
set myPath to "file://" & (do shell script "python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & quoted form of myFile)
end tell
--


Best wishes

John M



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: AppleScript runs slow on Intel Mac's
  • Next by Date: Re: AppleScript runs slow on Intel Mac's
  • Previous by thread: Re: Get .emlx file for Mail message?
  • Next by thread: Rép: AppleScript runs slow on Intel Mac's
  • Index(es):
    • Date
    • Thread