Mac Spotlight was behaving oddly with my Google Drive. It's not the obvious issue with indexing Google Docs files in Google Drive; was more subtle but it was fixable.
To begin with there's no problem with searching PDFs and other relatively standard files that are stored in Google Drive. They are fully indexed and searchable by title and contents. [4]
The problem is with Google documents, like those with the extension of .gsheet. Of course Spotlight can't index the contents; for most of mine there's nothing there to index anyway.[2]. What's odd is that Spotlight search on the file name didn't work from the spotlight title bar [1], but it did work from the folder search UI.
It turns out that I'd configured Spotlight preferences to exclude web pages from search results, and for Spotlight a Google Doc is a web page reference [2]. So the Google Docs were excluded from results. They showed up in the folder search because evidently Spotlight disregards file type preference there.
Next I had to address Mountain Lion's Folder Bar 'All My Files' list. Even after I revised Spotlight preferences that list didn't include my Google Folder docs.
I right clicked on 'All My Files' to see the Search Criteria -- mine showed Documents and "Kind is Other - com.microsoft.com" (Silverlight files it seems).
So all I needed to do was add the "Kinds" for the different Google Docs. I'm embarrassed to admin I tried file extensions and Google and Terminal.app and Get Info trying to figure out what "Kind" Spotlight assigned to these files (as distinct from Type, which was "Webpages"). The answer, of course, is simply to look at the Finder's detail list (duh). The kinds in my Google Drive were:
- "Google document" (extension .gdoc)
- "Google spreadsheet" (extension .gsheet)
- "Google drawing" (extension .gdraw)
- 10.7: Customize All My Files - Mac OS X Hints: Requires editing System Library - I never go there.
- Adjust All My Files criteria from the Finder - Mac OS X Hints: That's what I did.
- Smart ways to work with smart folders | Macworld: How to modify and more. Great summary.
- Quickly Add Items To The Dock Or Finder Sidebar [OS X Tip]
- Smart Folders in OS X Mountain Lion - For Dummies
- OS X Mountain Lion: Create or modify a Smart Folder: The "modify" advice is kind of cryptic.
- Gordon's Tech: Spotlight Calendar searches in Lion and Mountain Lion - kind of weird 8/13
- Gordon's Tech: Better Spotlight in 10.6: search current Finder folder and more 9/2010
- Gordon's Tech: Operators in Windows Search and Spotlight - Common and Similar 7/2010. This is one of my personal favorite posts.
[1] BTW, if you use the titlebar spotlight search and mouse over a result, you get a preview. You don't see filename or path though. If you hold the command key down, you will first see filename below the preview, then, after a second or two, it will alternate with path name.
[2] Here's what a gsheet content looks like in textwrangler (GUIDs truncated for security reasons)
{"url": "https://docs.google.com/spreadsheet/ccc?key=0AtgMeRwpi&usp=docslist_api", "resource_id": "spreadsheet:0AtgMec"}
[3] I'm guessing Google Drive installation tells OS X what Spotlight Kinds to associate with these file extensions.
[4] BTW, you can use Google Drive to convert Microsoft file types to Google formats.
[5] OS X Mountain Lion: Change the icon of a file or folder. Don't try to copy the preview icon, copy the wee icon at top of get info.
[6] It is a "Canned Search" Kind, not a "Saved Search" -- and it's a System File.
[7] Get Info shows the native search language version. Here's what I got when I added kinds without quotes:
(true) && ((((kMDItemContentTypeTree = public.content) || (kMDItemKind = "com.microsoft.*"cdw) || ((kMDItemKind = "Google*"cdw) && (kMDItemKind = "Spreadsheet*"cdw)) || ((kMDItemKind = "Google*"cdw) && (kMDItemKind = "document*"cdw)) || ((kMDItemKind = "Google*"cdw) && (kMDItemKind = "drawing*"cdw)))))
Here's the better results with quotes:
(true) && ((((kMDItemContentTypeTree = public.content) || (kMDItemKind = "com.microsoft.*"cdw) || (kMDItemKind = "Google Spreadsheet"cdw) || (kMDItemKind = "Google document"cdw) || (kMDItemKind = "Google drawing"cdw))))
[8] I'm not sure if this is new with Mountain Lion, but it looks like display of custom icons in the Finder Sidebar is a known issue.
No comments:
Post a Comment