I have this snippet of code… which goes through the list of recipients of an email, looking for ‘search_for’ in the display name… if true, I want to delete that recipient… but try as I might, I can’t seem to figure out the syntax of the delete command.
delete‚v : Delete an element from an object
delete specifier : the element to delete
Can someone point me in the right direction? Thanks in advance. cheers Neil
tell application “Microsoft Entourage”
if the class of the front window ≠draft window then
-- deleted code telling user to have email open...
end if
set theMsg to the front window
set theRecipients to every recipient of theMsg
repeat with theRecipient in theRecipients
set theAddress to the address of theRecipient
set theName to the display name of theAddress as Unicode text
if theName contains " search_for " then
delete theRecipient
end if
end repeat
Model: Macbook Air
Browser: Safari 531.21.10
Operating System: Mac OS X (10.6)