10.4: Make Finder find Mail messages and all vcards
Jul 06, '05 08:39:00AM
Contributed by: sjonke
By default, the Finder excludes Mail.app mail messages and Address Book vcards from searches. This exclusion does not appear in the default_smart.plist file inside the Finder bundle. However, if you save a search as a smart folder and then open it with a text editor, you will see these exclusions included as part of the "RAW" query, as seen here (line breaks added for readability):
<string>(* = "Search_Phrase*"wcd || kMDItemTextContent = "Search_Phrase*"cd)
&& (kMDItemContentType != com.apple.mail.emlx)
&& (kMDItemContentType != public.vcard)</string>
Rather then ponder the question of why these types are excluded, here is a (not for the feint-of-heart!) way of making the Finder find such items.
To do this hack, you need HexEdit, and you'll also need to either enable the root user and log in as them, or use Pseudo to launch HexEdit with admin privileges, or something similar.
- Open the /System/Library/CoreServices/ folder in the Finder.
- Control-click or right-click on the Finder and choose Show Package Contents from the pop-up.
- Navigate your way into the Contents/MacOS/ folder.
- Make a backup of the "Finder" executable (drag it to your Desktop).
- Launch the program HexEdit with admin/root privileges as noted above.
- Drag the "Finder" executable file onto HexEdit
- Search for the string (without the quotes, but including the leading space!), ' && (^1 != ^2) && (^1 != ^3)'.
- Make note of where this string starts and stops in the hex side of the window.
- In the hex side of the window, select the first of these (the space) and then change it and all the hex values of the string to 00. Be very sure to change the right number of them! Unfortunately, HexEdit doesn't seem to have a "type over" mode, so this is more of a pain then it should be.
- Quit and relaunch the Finder. One way to do this is to go to the Terminal and type killall Finder.
Enjoy your new found Finder mail message and vcard searching ways!
[robg adds: If you run a Finder search, you'll see that it does, in fact, return vCard matches from Address Book. After some digging, I believe I've figured out that the exclusion shown above (for public.vcard files) is there to exclude any networked Address Book data. So theoretically, making this change to your Finder will let you see the networked entries as well. However, I have not tested this hint, so I can't say for sure. But without any changes, the Finder will show the local vcards (but not Mail matches)...]
Comments (1)
Mac OS X Hints
http://hints.macworld.com/article.php?story=2005062110120673