Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Add color labels to message in Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add color labels to message in Mail.app
Authored by: cmittendorf on Jun 21, '04 10:55:36AM
You can write a script for the AppleScript menu of Mail like this:

tell application "Mail"
	set maillist to selection
	repeat with i from 1 to number of items in maillist
		set this_item to item i of maillist
		if class of this_item is message then
			set background color of this_item to blue
			-- other colors are
			-- gray / green / orange / red
		end if
	end repeat
end tell


[ Reply to This | # ]
Add color labels to message in Mail.app
Authored by: yopu on Jun 21, '04 11:54:34AM

Well, how do you know international users don't want to search for "colour"? :)


Chris (Canada)



[ Reply to This | # ]
Add color labels to message in Mail.app
Authored by: robg on Jun 21, '04 01:09:28PM

I'm sure they do ... but since I can't really write "color (colour)" or "colour (color)" for every instance in every article, I chose one ... and since I'm a biased American jerk, I chose color :).

cheers;
-rob.



[ Reply to This | # ]
Add color labels to message in Mail.app
Authored by: ether on Jun 22, '04 01:26:09PM

As a Canadian living in the US, I prefer colour, but have learned to live
with less vivid colors. :-)

But everyone is missing the point! By saying "I changed 'colour' to
'color'.", Rob ensured that either search will turn up the da{rm}n hint.
(Try 'colour label mail' in the search box...it turns up exactly the hint
in question. :-)

Talk about the tempest in the teapot!



[ Reply to This | # ]
Add color labels to message in Mail.app
Authored by: MichelP on Jun 22, '04 06:29:41AM

To make it even easier to use, and leveraging another hint into this one:
http://www.macosxhints.com/article.php?story=20040618161426854

just rename the scrip (or its alias) as:
Mail color___ctl-l.scpt

Then it will be invoqued by Control-L
(why L ? well to avoid conflicts with other key shortcuts, and call it Label rather that color/colour !!)

Now if some Script-geek can make the script more powerfull, in that it would propose a popup list of colors (including none): that would be a killer hint!
;-)



[ Reply to This | # ]
Add color labels to message in Mail.app
Authored by: iSierra on Jun 22, '04 07:42:43AM

The hint didn“t work for me, but yout little script did. Is there any way to be able to choose the color instead of having 5 versions of the script?



[ Reply to This | # ]
As a contextual menu item
Authored by: hombre on Jan 09, '05 06:00:57PM
I put the above applescript into some OnMyCommands. It gives you a 'Label' contextual menu item in Mail.app.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>COMMAND_LIST</key>
	<array>
		<dict>
			<key>ACTIVATE_ONLY_IN</key>
			<array>
				<string>Mail</string>
			</array>
			<key>COMMAND</key>
			<array>
				<string>tell application "Mail"
        set maillist to selection
        repeat with i from 1 to number of items in maillist
                set this_item to item i of maillist
                if class of this_item is message then
                        set background color of this_item to none
                end if
        end repeat
end tell
</string>
			</array>
			<key>EXECUTION_MODE</key>
			<string>exe_applescript</string>
			<key>NAME</key>
			<string>none</string>
			<key>SUBMENU_NAME</key>
			<string>Label</string>
			<key>VERSION</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key>ACTIVATE_ONLY_IN</key>
			<array>
				<string>Mail</string>
			</array>
			<key>COMMAND</key>
			<array>
				<string>tell application "Mail"
        set maillist to selection
        repeat with i from 1 to number of items in maillist
                set this_item to item i of maillist
                if class of this_item is message then
                        set background color of this_item to red
                end if
        end repeat
end tell
</string>
			</array>
			<key>EXECUTION_MODE</key>
			<string>exe_applescript</string>
			<key>NAME</key>
			<string>red</string>
			<key>SUBMENU_NAME</key>
			<string>Label</string>
			<key>VERSION</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key>ACTIVATE_ONLY_IN</key>
			<array>
				<string>Mail</string>
			</array>
			<key>COMMAND</key>
			<array>
				<string>tell application "Mail"
        set maillist to selection
        repeat with i from 1 to number of items in maillist
                set this_item to item i of maillist
                if class of this_item is message then
                        set background color of this_item to orange
                end if
        end repeat
end tell
</string>
			</array>
			<key>EXECUTION_MODE</key>
			<string>exe_applescript</string>
			<key>NAME</key>
			<string>orange</string>
			<key>SUBMENU_NAME</key>
			<string>Label</string>
			<key>VERSION</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key>ACTIVATE_ONLY_IN</key>
			<array>
				<string>Mail</string>
			</array>
			<key>COMMAND</key>
			<array>
				<string>tell application "Mail"
        set maillist to selection
        repeat with i from 1 to number of items in maillist
                set this_item to item i of maillist
                if class of this_item is message then
                        set background color of this_item to yellow
                end if
        end repeat
end tell
</string>
			</array>
			<key>EXECUTION_MODE</key>
			<string>exe_applescript</string>
			<key>NAME</key>
			<string>yellow</string>
			<key>SUBMENU_NAME</key>
			<string>Label</string>
			<key>VERSION</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key>ACTIVATE_ONLY_IN</key>
			<array>
				<string>Mail</string>
			</array>
			<key>COMMAND</key>
			<array>
				<string>tell application "Mail"
        set maillist to selection
        repeat with i from 1 to number of items in maillist
                set this_item to item i of maillist
                if class of this_item is message then
                        set background color of this_item to green
                end if
        end repeat
end tell
</string>
			</array>
			<key>EXECUTION_MODE</key>
			<string>exe_applescript</string>
			<key>NAME</key>
			<string>green</string>
			<key>SUBMENU_NAME</key>
			<string>Label</string>
			<key>VERSION</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key>ACTIVATE_ONLY_IN</key>
			<array>
				<string>Mail</string>
			</array>
			<key>COMMAND</key>
			<array>
				<string>tell application "Mail"
        set maillist to selection
        repeat with i from 1 to number of items in maillist
                set this_item to item i of maillist
                if class of this_item is message then
                        set background color of this_item to blue
                end if
        end repeat
end tell
</string>
			</array>
			<key>EXECUTION_MODE</key>
			<string>exe_applescript</string>
			<key>NAME</key>
			<string>blue</string>
			<key>SUBMENU_NAME</key>
			<string>Label</string>
			<key>VERSION</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key>ACTIVATE_ONLY_IN</key>
			<array>
				<string>Mail</string>
			</array>
			<key>COMMAND</key>
			<array>
				<string>tell application "Mail"
        set maillist to selection
        repeat with i from 1 to number of items in maillist
                set this_item to item i of maillist
                if class of this_item is message then
                        set background color of this_item to purple
                end if
        end repeat
end tell
</string>
			</array>
			<key>EXECUTION_MODE</key>
			<string>exe_applescript</string>
			<key>NAME</key>
			<string>purple</string>
			<key>SUBMENU_NAME</key>
			<string>Label</string>
			<key>VERSION</key>
			<integer>1</integer>
		</dict>
		<dict>
			<key>ACTIVATE_ONLY_IN</key>
			<array>
				<string>Mail</string>
			</array>
			<key>COMMAND</key>
			<array>
				<string>tell application "Mail"
        set maillist to selection
        repeat with i from 1 to number of items in maillist
                set this_item to item i of maillist
                if class of this_item is message then
                        set background color of this_item to gray
                end if
        end repeat
end tell
</string>
			</array>
			<key>EXECUTION_MODE</key>
			<string>exe_applescript</string>
			<key>NAME</key>
			<string>gray</string>
			<key>SUBMENU_NAME</key>
			<string>Label</string>
			<key>VERSION</key>
			<integer>1</integer>
		</dict>
	</array>
	<key>VERSION</key>
	<integer>2</integer>
</dict>
</plist>


[ Reply to This | # ]
Add color labels to message in Mail.app
Authored by: ppayne on May 05, '05 04:16:43AM

Thank you! You have solved my problem. I am finally moving from Eudora but love to have my messages color coded so I know that I can forget them. I added the following

set flagged status of this_item to 1

which also flags the current messages, since there's no way to sort by color. This works fine with Tiger Mail



[ Reply to This | # ]
Add color labels to message in Mail.app
Authored by: gregs on May 16, '05 03:45:21PM

Why not use Format -> Show Colors (Shift-cmd C), then pick the color you want?
It's pretty quick if you use the keyboard short-cut.



[ Reply to This | # ]