Skip to content

Instantly share code, notes, and snippets.

@scottslowe
Created December 16, 2013 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottslowe/7990921 to your computer and use it in GitHub Desktop.
Save scottslowe/7990921 to your computer and use it in GitHub Desktop.
This AppleScript can be used to help quickly file spam messages into a spam training folder
-- This script moves messages to a spam training folder
-- Set some default values to be used later in the script; not all values may be used
property destMailbox : "Spam Training"
property destAccount : "example.com"
-- Handler called when running script from script menu
on run
tell application "Mail"
set theSelectedMessages to selection
if ((count of theSelectedMessages) < 1) then
beep
return
end if
repeat with theMessage in theSelectedMessages
if (read status of theMessage) is false then
set read status of theMessage to true
end if
move theMessage to mailbox destMailbox of account destAccount
end repeat
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment