Email flags in Mac Mail

Hi all,

Has anyone devised a way of assigning different coloured flags to different keyboard shortcuts on the Mac? I use different coloured flags for different things, and it would be helpful to have an option other than the simple toggle.

Views gratefully received.

With thanks,

This AppleScript will set the flag of the selected message to red:

tell application "Mail"
	set msg to item 1 of (get selection)
	tell msg
		set flag index to 0
	end tell
end tell

Change 0 to 1 or 2 or 3 or 4 or 5 or 6 for different colors.
Change 0 to -1 to remove the flag

Also check out this post by Chris.

One additional tip, if you're using sieve server side rules, you can set colors there too!

  • Orange = $MailFlagBit0
  • Yellow = $MailFlagBit1
  • Green = $MailFlagBit0 & $MailFlagBit1
  • Blue = $MailFlagBit2 (100)
  • Purple = $MailFlagBit0 & $MailFlagBit2 (101)
  • Grey = $MailFlagBit1 & $MailFlagBit2 (110)

For example, I use purelymail for my own domain and here are my sieve filter rules for 'Green'

Keyboard Shortcuts in the Keyboard section of System Settings?