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

10.4: Use Spotlight comments to tag Mail messages Apps
Tiger only hintI was always distraught that I could not create unique tags for emails in Mail.app, but now that they are individual files in your library, you can do it in a roundabout way.

Set up unique mail folders (in Mail.app), and an Automator workflow to tag all of the individual emails in each unique folder (in library) with the Spotlight tag of your choice. You can also set up iCal to run your Automator workflow every morning to keep up to date.

It has helped me tremendously in keeping track of project related emails through Spotlight. And combined with Spotlight file tags, I can now get by without Entourage X's project center. With all of these capabilities (not integrated), maybe there is an iProject or iWorkflow around the corner...
    •    
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[19,482 views]  

10.4: Use Spotlight comments to tag Mail messages | 9 comments | Create New Account
Click here to return to the '10.4: Use Spotlight comments to tag Mail messages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Spotlight comments to tag Mail messages
Authored by: fresler on Jun 08, '05 10:15:01AM

This sounds great and would work well for me, but could you provide an example workflow? Thanks!



[ Reply to This | # ]
10.4: Use Spotlight comments to tag Mail messages
Authored by: da5idonimac on Jun 08, '05 10:44:58AM

actually, it is quite easy - i used this hint to create my first automator workflow i might actually use (and that works!).

here are step-by-step instructions:
1. in mail, create a new mailbox (not an intelligent folder)

2. move some emails in there (to test)

3. in automator do this:
3.1. add the action "get specified finder items" - in the box, add the path to the mailbox folder (found in user/library/mail/mailboxes)

3.2 add the action "get folder contents"*. select the checkbox to repeat for subfolders*.

3.3. add the action "add spotlight comment to finder objects"* with the wanted spotlight comments.

4. run the script to test. go to the mailbox folder, find you messages and show the file info. you should see your spotlight comments there.

* or similar. i only have the german version running and have to translate some actions myself.



[ Reply to This | # ]
10.4: Use Spotlight comments to tag Mail messages
Authored by: smorr on Jun 08, '05 10:19:28AM
I am working on a mail plugin to do just this: add annotations to messages, set status, project, tickle (due) dates. Right now we have it adding annotations and have these annotations searchable in mail and in spotlight (and yes, the are captured in mail's smart folders) -- we are still working a few issues and we still have some features to implement but it is in the works. If you want to be a guinea pig beta tester. reply to me privately.

Note this will be added functionality to my Mail Act-On plug-in.

[ Reply to This | # ]

10.4: Use Spotlight comments to tag Mail messages
Authored by: da5idonimac on Jun 08, '05 10:31:28AM

thanks for the great hint. this will help me a lot. if this worked with intelligent folders too, it would be even better. but then again, the poster is certainly not to blame ;)
as a side note: wouldn't it be great to be able to attach an automator script to an intelligent mailbox (as a sort of spotlight-automator integration), so that the script is started, when a new object is added to the intelligent folder?



[ Reply to This | # ]
10.4: Use Spotlight comments to tag Mail messages
Authored by: bellis1 on Jun 08, '05 11:25:34AM

Keep us up to date on the plugin it would be a much easier work around. For the automator tagging I use:

1. get specified finder items
(individual mail folder in library that matches mail folder)
2. get folder contents
3. add spotlight comment

and then I save each of these as single applications. Next I made one automator application which is launches each of those applications:

1. Launch application
2. Launch application
3. etc.

Lastly, I just have scheduled ical to run that application each morning so all I have to do is drag my messages to the correct folder in mail.app and it will get tagged correctly each morning. Hope that makes it a little bit more clear. There must be a simpler way I just could'nt think of it.



[ Reply to This | # ]
10.4: Use Spotlight comments to tag Mail messages
Authored by: raphaeld on Jun 08, '05 01:52:53PM

Great hint. I modified your idea somewhat with an AppleScript. You still need the Automator workflow. From Mail, you highlight the documents you want to move to the project mailbox and run this script. It will move the messages and run the Automator workflow. Here's the script below. If you're showing your scripts in your menu bar (using the Applescript utility) you can run this directly from Mail.


tell application "Mail"
activate
set selectedMessages to selection

set selCount to (count of the selectedMessages)

if selCount = 0 then

display dialog "You must select at least one mail message first." buttons {"OK"}

else
set theMailbox to "your mailbox name here"
-- fill in the name of the mailbox (remember to use the double-quotes

tell application "Mail"
move the selection to mailbox theMailbox
end tell

tell application "Finder"

set pathToApp to (path to home folder as string) & "the app location"
-- i.e. if the workflow is stored as an application (called SpotlightMail.app)
-- in a folder called Workflows in your documents folder you should enter
-- "Documents:Workflows:SpotlightMail.app"
-- remember to use the double-quotes

open pathToApp
end tell
end if

end tell



[ Reply to This | # ]
10.4: Use Spotlight comments to tag Mail messages
Authored by: William McCallum on Jun 08, '05 02:26:00PM

There's also MessageLaser at http://www.jeffporten.com/software



[ Reply to This | # ]
10.4: Use Spotlight comments to tag Mail messages
Authored by: smorr on Jun 09, '05 09:28:25AM
Alert!

In addition to various shortcomings (such as not seeing the note in mail itself), there is a significant and potentially dangerous flaw with this technique and with Jeff Porten's MessageLaser script. These techniques set the finder comment. However, when you move (or copy) a message in Mail (from folder to folder), Mail will not move/copy the file. Rather it reads the file and writes a new emlx file in the new location Consequently any annotation you add with an applescript or action will be deleted because Mail does not copy the finder comments when moving messages.

So if you are searching for tags, it will not turn up any previously tagged message that was moved. Mail itself has to be patched (with a plugin) to overcome this issue.

[ Reply to This | # ]

10.4: Use Spotlight comments to tag Mail messages
Authored by: jporten on Jun 09, '05 04:28:13PM

Ugh. Confirming this behavior. What I'm seeing here is that after you move a message, the original message is retained temporarily in the file structure and still responds to Spotlight, but the new copy does not. Thanks for pointing this out, I'll get on it.



[ Reply to This | # ]