Jump to content

Google Drive — List File Stream contents from Google Drive


Recommended Posts

Quote

That would require a huge database and essentially replicating a mini Spotlight.

 

That's sort of exactly what this page claims that this plugin does. It's the very reason I spent the money to purchase Alfred in the first place. At the time, this was the only way to get any kind of Finder-level indexing of DFS. But now Google Drive has better Spotlight support than Alfred...

 

Link to comment

Hi @vitor,

 

First of all, congratulations on the product 🙂

 

I was using Google Drive's workflow up until a few weeks ago, and then it stopped working for some reason. I just reinstalled the workflow, but I am unable to get it working again. I tried building the cache by hitting the option below, and also by running this command (:gdrebuildcache) in Alfred's search box.

 

 

image.thumb.png.6364dd057ed6181ee5e9a40e5ce49ff4.png

 

Could you let me know what else I need to do to get it working again? Thank you!

Link to comment
5 hours ago, Henryy said:

Does NOT Exist: /Volumes/GoogleDrive


Your Google Drive folder is not set correctly. Google probably updated you to the new version which changes its location. You’ll need to update it (instructions in previously linked post)  for changes to continue to be detected.

Link to comment
  • 2 weeks later...

Hi there — 

 

Vitor, thanks don't begin to describe my gratitude for this and the many other workflows you have created and maintain.

 

A quick question / request on this Google Drive workflow: would it be possible to add-in fallback results to conduct a browser search on the Google drive page? That is, regardless of the query input, the last option in list of results would be "Search for {query} in browser" by dropping {query} into https://drive.google.com/drive/u/0/search?q={query}

 

A little detail on why I think this would be helpful — my drive is comprised of a mix of files that I own and files that have been shared with me; the latter of which don't show up in my drive unless manually moved. However, searching the full google drive via browser results in the full scope being searched which helps me find files quicker.

Link to comment

Welcome @spencer,

 

1 hour ago, spencer said:

Vitor, thanks don't begin to describe my gratitude for this and the many other workflows you have created and maintain.

 

Thank you for the kind words!

 

1 hour ago, spencer said:

would it be possible to add-in fallback results to conduct a browser search on the Google drive page?

 

That makes perfect sense. When making a Google Drive search with gd or gdf one can already press ⇧↩ to search the match online. And the workflow also has Fallback Searches already, but they only do the equivalent of gd and gdf. So for consistency, I can make it so the Fallback Searches do an online search when pressing ⇧↩ as well.


Like so. That version will be available to update from the Gallery soon.

 

1 hour ago, spencer said:

A little detail on why I think this would be helpful

 

Thank you as well for the details. Understanding the goals makes the solution more straightforward.

Link to comment

Thanks a lot, @vitor — can't believe you were able to pick that up so quick and update :)

 

The ⇧↩ enabled on the Fallback Search is amazing and works exactly as I'd hoped! 

 

A follow up question on the ⇧↩ action when using gd — it appears to work only for when there's a match in the results populated via Script_filter_items. Would it be possible add a result at the end of that array that when actioned, conducts the search online? For example, if I have multiple documents in Google Drive with the word 'test' in title, it pops up the following results: 

 

image.png.d185d39c6fa99f6f6ce18b8f2a1becfb.png

 

However, when searching for test online, there are results that include 'test' in the document itself, or perhaps in titles of documents shared with me, etc.

 

Therefore, by having an option accessible at the end of the search results shown, or via 4 in this instance, I can quickly pop up that full view in the browser. I could of course get around this by just searching in the default Alfred bar, but my brain is trained pretty heavy on my shortcut to access the Google Drive workflow when looking for a particular document (and in the case that it's not in my drive folder, or the gd filter returns no results, I could then quickly conduct a full search online). 

 

Additionally, actioning the "Nothing Found" item in the results window with ⇧↩ doesn't appear to do anything either.

 

image.png.0a074069427e5da215b81f86bf1ba8c8.png

Link to comment

Hi- Google Drive recently migrated all my files to 'Locations' on the Mac, apparently for compatibility. 

 

Now, the Workflow doesn't find anything and when I re-index it returns really fast- and so it seems like maybe it's not finding anything. 

 

Is there an update or do I need to reconfigure the Workflow somehow?

Link to comment

@spencer You can get that by setting Alfred to Intelligently show fallbacks at the end of results in Alfred Preferences → Default Results → Fallbacks.

 

That said, I absolutely see the value in the idea. This version works like that. Consider it a trial run for the feature; a lot of people use the workflow and this can technically be achieved with the Fallback Results, so it may be removed depending on feedback. That said, even if it’s removed I see the sense in keeping it for the “Nothing found” case.

Link to comment
  • 2 weeks later...

My Google Drive implemented a change this morning that relocated the shared folders to "Locations" within Finder.

 

Apparently this broke the workflow, as I cannot rebuild the cache and my search will not open any formerly cached items now.

 

It looks like perhaps this new location is being indexed by macOS, because I can find items in Spotlight now. But I changed the location in my workflow settings, and rebuild cache still isn't working.

 

Is the Google Drive new "Locations" setup incompatible with this workflow?

Link to comment

@benwhiting Please see the debugging instructions.

 

Two things to note regarding the indexing:

  • The method the Google Drive app is using to show up in Spotlight is a different API. Results show up slower and they’re not added to the index with all other files.
  • Some people have reported that with Google Drive’s switch to the macOS File Provider API, files now show under regular Alfred searches. It’s not yet clear why it’s not the same for everyone, but try that too:

You may need to go into Alfred Preferences → Features → Default Results → Search Scope → Reset… (bottom right) and try some of the options. If it works, It’d be useful to know which of the settings made it work for you.

Link to comment

The Drive update is working pretty well for me, though the frequency bias that Alfred assigns to regularly accessed items is still learning because I haven't accessed these files through normal file search before.

 

I just wanted to say a huge thank you to you, @vitor for your work on this workflow. It was incredibly helpful to me while Google figured things out, as it allowed me to continue using Alfred for all my files, and it even helped me learn more about workflows in general so I could make small customizations. You're amazing!

Link to comment

Hi everyone, for me, everything is broken since Drive update :( 

  • :gdrebuildcache fails, even with the correct Drive Path given (~/Library/CloudStorage/*****@*****.tld).
  • it block on the gdrive_path.find.lazy.each which never returns : process last forever, I have to kill it manually ...
  • same occurs for !gddiagnostic : it blocks on find "${google_drive_path}" | wc -l | tr -d ' \n' (If I comment this, I got a return).
  • the Alfred File Search (so out of the workflow) is ok EXCEPT for the files in .shortcut-targets-by-id (those who are shared to me, but not on a Shared Drive). Unfortunality I've got a lot of them ...

 

So I'm stuck with no solution for the moment. I wish Google would inform us of the changes and let us choose the version 😕 

I hope that this so-fast-and-clever workflow will function again someday :) 

Link to comment

Welcome @dam75,

 

The workflow does work for thousands of people, I’ve never seen anyone with the errors you’re mentioning. Especially if you can’t run the diagnostic, something is quite atypical on your machine. Make sure Alfred has Full Disk Access and that you’re using the version from the Gallery.


If you get the diagnostic by removing that line, then please provide that. Even incomplete information may provide a clue.

Link to comment
19 minutes ago, vitor said:

If you get the diagnostic by removing that line, then please provide that. Even incomplete information may provide a clue.

 

Thank you so much for your quick answer ! 

Here is the diagnostic informations, with the "find" removed ^^

Yes, Alfred have a full disk access ... 

 

### Workflow version
2023.3
### Alfred version
5.0.6
### macOS version
13.1
### Architecture
arm64
### Preferences
Dict {
    auto_refresh = false
    google_drive_path = /Users/xxxx/Library/CloudStorage/*****@*****.tld
    search_keyword = ''
    result_limit = 50
    ignore_list = .Encrypted/
}
### Full Disk Access
Granted
### Google drive path
Exists: /Users/xxxx/Library/CloudStorage/*****@*****.tld
 paths
### Cache dir
Files NOT present
### Cache file
Does NOT exist
### Temporary cache
Does NOT exist
### Build progress
NOT running
### Launchd job
NOT loaded
NOT installed


 

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...