Jump to content

Google Drive Search (via Google Drive File Stream)

Recommended Posts

This workflow searches Google Drive via the Google Drive File Stream app. Currently, Spotlight is the main method for searching but is unreliable. (It would be great to get some feedback on why this is.) As a backup, the user has the option to use a file index created by an included Ruby script to search - this is more reliable but also much slower. Feedback is welcome!



Link to comment
  • 2 months later...

Thanks! Glad it's working for you.


To open files in Google Drive:

  • Google Doc extensions (.gdoc, .gsheet, etc.) should open in Google Drive automatically, as long as they're set to open with the Google Drive File Stream app (which they should be by default - it may also be called just "Google Drive" depending on the version you have).
  • Other files can be set to open in Google Drive by setting each file type to automatically open in "openInGoogleDrive.app", which is included in my Alfred workflow. In Alfred, right-click the workflow and then pick "Open in Finder" to see its location. Then for each file type that you want to open in Google Drive, set openInGoogleDrive.app as the default (detailed instructions at https://www.imore.com/how-set-mac-app-default-when-opening-file#file). Note that this is basically just a quick way of right-clicking the file and selecting "Open with Google Drive" - it's not the fastest or most elegant solution, but it's the only one I see available right now for non-Google file types.

Also FYI, at least on my end, Spotlight indexing is working very reliably after recent updates to Google Drive File Stream, so I don't even really need the Ruby backup anymore.

Link to comment
  • 1 month later...

I had this app working beautifully until I updated to 11.3.1 but then something broke...I'd appreciate any help in understanding why.


Thank you,

Link to comment
  • 2 weeks later...

I have a MacBook and want to use Alfred to search google file stream mounted drive but the issue is that works some days and not other days 


I’m using the https://www.packal.org/workflow/google-drive-search workflow


I have to Trigger using the keyword (;), then hold control and press return to initialize.

It states Indexing must complete before searching will work.


This takes about 5-20 mins and sometimes it works and other times it doesn’t work. 

Any help would be fab !


it’s driving me mad as I need to search about 20 times a day.


Any help would be fab 😁

Link to comment

Hi @WhiteFusion, welcome to the forum. I've merged your thread with the actual thread for the workflow (it was linked on the Packal page). When you have a question about a workflow in the future, please first look for an existing thread for the workflow, and ask in there if one exists.

Link to comment
  • 1 month later...

Yes, it should work on Big Sur. If you're getting your Google Drive files to show up in a Spotlight search, then the workflow should work. A few troubleshooting steps I can think of:

  • If your Google Drive files do not appear in Spotlight, you need to re-index. Note that when I did this, it took a long time (~3-4 h) but it was a one-time fix. https://www.cultofmac.com/131619/fix-your-spotlight-search-results-by-forcing-spotlight-to-re-index-os-x-tips/
  • Check the workspace variables in Alfred to ensure it's looking at the correct location of your Google Drive files. (If I remember correctly, /Volumes/GoogleDrive is the default.)
  • When you're looking at the workspace variables, check out the comments on the left and make sure everything is configured as instructed.

I actually don't have a Mac anymore, so I unfortunately can't guide you with more detailed troubleshooting, but hopefully this helps.

Link to comment
  • 3 weeks later...
15 hours ago, stefano said:

Since the last update of google drive it seems that is not working anymore.

any idea?


I have the same problem since the update on Monday morning.


I'm running Alfred 4.3.4 [1229] on MacOS Big Sur (11.3)


The Files which I want to search are offline available in the Google Drive folder, like before. I also moved the Google Drive folder to my user's home directory, to make sure the path /volume/... is not causing this issue.


Now the directory is "~/Google Drive - AufBau




I tried the "File Search Troubleshooting" (Help>Troubleshooting>File Search Troubleshooting) with the following result


Starting Diagnostics...

File: '50_Kunden-Projekte'
Path: '/Users/henryauffahrt/Google Drive - AufBau/Shared drives'


Check file cache database...

 File cache integrity is ok


Check if file is readable...

 Alfred has permissions to read this file.


Check if volume '/' is indexed by macOS...

 Indexing is enabled on this drive


Check direct file metadata...

 Direct metadata available

Display Name: 50_Kunden-Projekte
 Other Names: 
Content Type: public.folder
   Last Used: 2021-07-20 07:02:23 +0000


Check mdls file metadata...

 macOS metadata missing essential items

kMDItemFSContentChangeDate = 2021-07-20 07:02:23 +0000
kMDItemFSCreationDate      = 1970-01-01 00:00:00 +0000
kMDItemFSCreatorCode       = ""
kMDItemFSFinderFlags       = 1024
kMDItemFSHasCustomIcon     = 1
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery      = 0
kMDItemFSLabel             = 0
kMDItemFSName              = "50_Kunden-Projekte"
kMDItemFSNodeCount         = 0
kMDItemFSOwnerGroupID      = 20
kMDItemFSOwnerUserID       = 501
kMDItemFSSize              = 0
kMDItemFSTypeCode          = ""


 Troubleshooting failed


What I tried to solve the problem on my own:

Has anyone an Idea how to solve this problem? Is this a problem we should inform the Google Team about?


It is very annoying since I have ALL my files in this Google Workspace / Google Drive Accounts.


I appreciate any kind of help!


Link to comment

I don't think there's a real solution to this problem right now.


1) It's possible to get this workflow to work using these instructions, however this workflow will open all files in the browser (fine for Google Docs/Sheets etc, but sometimes you might want the file to open in finder).


2) It's possible to force index Google Drive by using these instructions, however I believe it will download all files offline. It won't work with "online only" files.


I've tried to open a ticket with Google via their Google Workspace support (and I encourage anyone else that pays for GSuite / Google Workspace to do the same!) So far, not very helpful.

Edited by alfredpanda
Link to comment
2 hours ago, alfredpanda said:

2) It's possible to force index Google Drive by using these instructions, however I believe it will download all files offline. It won't work with "online only" files.

This would be enough for me for the meantime. But I get an error message when using "mdutil -s" or "mdutil -i on"


This is the error message:

Error: unknown indexing state.


Any idea?

After trying as root I get now this error message:

Error: unable to perform operation.  (-407)
	Error: unknown indexing state.


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...