Re: Searching a Mail message
Re: Searching a Mail message
- Subject: Re: Searching a Mail message
- From: Philip Aker <email@hidden>
- Date: Sun, 3 Jun 2007 07:26:29 -0700
On 2007-06-02, at 13:52:38, Doug McNutt wrote:
Nice link Doug,
I did a variant of the short form in Tcl and it works remarkably well.
However, for the purposes of using it to grab email addresses from an arbitrary Mail message (using Luther's 'content of'), the results, although generallly better than Deivy's, are not 100% accurate and in some cases return nothing when one can clearly see there is a valid email address in the content.
Neither is using 'source of' because then it will also return all @s in the headers. Change 'content of' to 'source of' to see the difference.
tell application "Mail" to set m to (content of item 1 of (get selection)) as text set res to {} set {tids, AppleScript's text item delimiters} to {AppleScript's text item delimiters, space} set res to text items of (do shell script "echo 'puts [lsort -dictionary -unique [regexp -all -nocase -inline -- {[0-9A-Z._%-]+@[0-9A-Z.-]+[A-Z]{2,4}} {'" & quoted form of m & "'}]]' | tclsh") set AppleScript's text item delimiters to tids res
Philip Aker email@hidden
|
_______________________________________________
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