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


Click here to return to the 'As a contextual menu item' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
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 | # ]