Skip to content

Instantly share code, notes, and snippets.

@scottslowe
Created June 15, 2013 13:20
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/5788104 to your computer and use it in GitHub Desktop.
Save scottslowe/5788104 to your computer and use it in GitHub Desktop.
This AppleScript, designed to be used with MailTags and Mail.app, assigns one or more keywords to the selected messages.
-- This script assigns MailTags keywords to the selected messages
-- Set some default values to be used later in the script
property assignedKeywords : {"Personal"}
-- 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
using terms from application "MailTagsHelper"
repeat with theMessage in theSelectedMessages
set keywords of theMessage to assignedKeywords
end repeat
end using terms from
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment