• 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: Copy ONLY the from "email address" from the current selected apple mail email Following
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copy ONLY the from "email address" from the current selected apple mail email Following


  • Subject: Re: Copy ONLY the from "email address" from the current selected apple mail email Following
  • From: Yvan KOENIG <email@hidden>
  • Date: Sun, 26 Jul 2015 22:44:56 +0200


Le 26/07/2015 à 22:31, Dave <email@hidden> a écrit :

I am try to create a simple AS that can copy ONLY the from "email address" from the current selected apple mail email and not the name also.
 …


You may use :

tell application "Mail"
set theSelectedMessages to the selection
set eachMessage to item 1 of theSelectedMessages
log result
set theSender to sender of eachMessage
set theSenderAsList to my decoupe(theSender, {"<", ">"})
log result
set cleanSender to item 2 of theSenderAsList
log result
set the clipboard to cleanSender
end tell

#=====

on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe

#=====

You may reduce it to :

tell application "Mail"
set eachMessage to item 1 of (get the selection)
set the clipboard to item 2 of my decoupe(sender of eachMessage, {"<", ">"})
end tell

#=====

on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe

#=====



Yvan KOENIG running Yosemite 10.10.4 in French (VALLAURIS, France) dimanche 26 juillet 2015 22:44:51





 _______________________________________________
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

  • Follow-Ups:
    • Re: Copy ONLY the from "email address" from the current selected apple mail email Following
      • From: Mark Hunte <email@hidden>
References: 
 >Copy ONLY the from "email address" from the current selected apple mail email Following (From: Dave <email@hidden>)

  • Prev by Date: Copy ONLY the from "email address" from the current selected apple mail email Following
  • Next by Date: Re: Copy ONLY the from "email address" from the current selected apple mail email Following
  • Previous by thread: Copy ONLY the from "email address" from the current selected apple mail email Following
  • Next by thread: Re: Copy ONLY the from "email address" from the current selected apple mail email Following
  • Index(es):
    • Date
    • Thread