Created
May 24, 2011 22:35
-
-
Save theduderog/989911 to your computer and use it in GitHub Desktop.
MS Outlook for Mac - get rid of yourself in "Reply All"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Microsoft Outlook" | |
set myAlias to "[email protected]" | |
set listMessages to selected objects | |
set theMessage to first item of listMessages | |
set outgoingMessage to reply to theMessage | |
set theSender to sender of outgoingMessage | |
set theSenderAddress to the address of theSender | |
set theSenderName to the name of theSender | |
set theToRecipients to every to recipient of theMessage | |
repeat with i from 1 to count theToRecipients | |
set theRecipient to item i of theToRecipients | |
set theEmailAddressElement to the email address of theRecipient | |
set theEmailAddressText to the address of theEmailAddressElement | |
try | |
set theEmailAddressName to the name of theEmailAddressElement | |
set newProperties to {email address:{address:theEmailAddressText, name:theEmailAddressName}} | |
on error | |
set newProperties to {email address:{address:theEmailAddressText}} | |
end try | |
if (not (theSenderName contains theEmailAddressText or theSenderAddress contains theEmailAddressText)) then | |
if theEmailAddressText does not contain myAlias then | |
tell outgoingMessage | |
make new to recipient with properties newProperties | |
end tell | |
end if | |
end if | |
end repeat | |
set theCcRecipients to every cc recipient of theMessage | |
repeat with i from 1 to count theCcRecipients | |
set theRecipient to item i of theCcRecipients | |
set theEmailAddressElement to the email address of theRecipient | |
set theEmailAddressText to the address of theEmailAddressElement | |
try | |
set theEmailAddressName to the name of theEmailAddressElement | |
set newProperties to {email address:{address:theEmailAddressText, name:theEmailAddressName}} | |
on error | |
set newProperties to {email address:{address:theEmailAddressText}} | |
end try | |
if (not (theSenderName contains theEmailAddressText or theSenderAddress contains theEmailAddressText)) then | |
if theEmailAddressText does not contain myAlias then | |
tell outgoingMessage | |
make new cc recipient with properties newProperties | |
end tell | |
end if | |
end if | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minor enhancement to Kurt Partridge's answer on Quora