Dec 21, '09 07:30:03AM • Contributed by: NaOH-Lye
I've looked at all the tagging and organizing applications I could find (Yojimbo, Tags, DevonThink, etc.). For my tastes, they all suffer from one of a few common limitations, all of which ruled them out for me: some applications duplicate files, some require a background process, and some had an interface I simply didn't like. Perhaps worst for me was how the applications stored tag metadata. The most common methods are an application-specific database or, worse, Spotlight Comments. The database method means all my tagging is dependent on one file, and the Spotlight Comments method has numerous instances when the metadata doesn't transfer if files are moved, such as when e-mailing files.
Snow Leopard, like Leopard before it, allows you to add keywords to a PDF when using the Print » Save as PDF feature. The big advantage of this method is that the metadata is stored in the file. Snow Leopard, though, adds a new feature that's very helpful. It now remembers previously-used keywords. If you use Print » Save as PDF to add the keyword macosxhints to a file, the next time a PDF is being saved with the Print » Save as PDF button, this keyword will be an autocomplete option if the text being entered matches. Note, though, that the autocomplete feature only seems to be available in the Print » Save as PDF dialog, though keywords added using any method in one application (e.g., TextEdit) will be available in another (e.g., Safari).
Keyword tagging can also be applied in Microsoft Office documents via the File » Document Properties dialog. TextEdit can have them added via the File » Show Properties dialog. Photoshop also allows this via the File » File Info command. InDesign and Illustrator do, too, but this metadata is not accessible by Spotlight. There are probably other applications that work, but that's what I've tested so far. Note that for any file which has keywords which Spotlight can read, the information can be seen in a Finder Get Info window by looking in the More Info section.
Once keywords have been added to files, they can be searched for by using the keyword criterion of Spotlight. Using the Find window in Finder, click the Kind button, then select Other. In the window that opens, select Keywords. To save a keyword search as a Smart Folder, simply click the Save button. For those who use the Spotlight menu, the following format allows keyword-based searches:
keyword:SearchTermFor multiple search terms, separate them with spaces. For example, keyword:system settings. For multi-word search terms, enter them in quotes separated by spaces. For example, keyword:"operating system".
Should you ever need to edit the keywords of an existing PDF, open the file in Preview and use Tools » Show Inspector (Command-I) menu. In the Keyword tab, indicated by the Spotlight-style magnifying glass icon, you can add or remove keywords.
Since I frequently create Smart Folders for Finder-based organization, I pieced together an AppleScript to streamline the process of creating them. I'm certain someone could write this script more elegantly, but it works and has been tested in 10.5 and 10.6. The script, as written, will automatically save the Smart Folder to the Desktop folder.
display dialog "Enter Smart Folder keywords separated by spaces:" default answer "" buttons {"Cancel", "Continue"} default button 2
if (button returned of result) is "Continue" then
set the clipboard to "keyword:" & text returned of the result
tell application "Finder" to activate
tell application "System Events" to tell process "Finder"
keystroke "n" using {command down, option down}
keystroke "v" using command down
end tell
delay 0.2
tell application "Finder"
display dialog "Name for the new Smart Folder:" default answer "Untitled Folder" buttons {"Cancel", "OK"} default button 2 with icon 1
end tell
if (button returned of result) is "OK" then
set the clipboard to text returned of the result
tell application "Finder" to activate
tell application "System Events" to tell process "Finder"
delay 0.3
click button 2 of group 1 of splitter group 1 of window 1
delay 1
keystroke "v" using command down
key code 36
end tell
set filePath to (path to desktop as text) & (the clipboard) & ".savedSearch"
end if
end ifFor keyword-based searching in 10.4, I couldn't find a way to do it using the Spotlight menu. This means the above script won't work. However, it can be done using the Find window method described above. As an added bonus exclusive to 10.4 users, when entering keywords in the Find window, an autocomplete feature of keywords in the Spotlight index is provided.
