-- Mailsmith - Whitelist Recipients -- https://c-command.com/scripts/spamsieve/mailsmith-whitelist-recipients -- Summary: Adds the recipients of the current message to SpamSieve’s whitelist. -- Requires: SpamSieve, Mailsmith -- Install Location: Mailsmith Support/Scripts/ -- Last Modified: 2019-05-24 on doAction(mList) tell application "Mailsmith" set theAddresses to {} repeat with m in mList repeat with r in m's to_recipients copy r's address string to end of theAddresses end repeat repeat with r in m's cc_recipients copy r's address string to end of theAddresses end repeat repeat with r in m's bcc_recipients copy r's address string to end of theAddresses end repeat end repeat tell application "SpamSieve" tell whitelist add sender rules for addresses theAddresses end tell end tell end tell end doAction on run set theList to getList() if theList is not {} then my doAction(theList) else display dialog "No messages were selected" buttons "OK" end if end run on filtermessage(m) my doAction({m}) end filtermessage on getList() tell application "Mailsmith" set retry to false try set mList to get selection as list set m to item 1 of mList if class of m is not message then set retry to true on error set retry to true end try if retry then set retry to false try set mList to message of window 1 as list on error set retry to true end try end if if retry then set mList to {} end tell return mList end getList