Jump to content

Google Drive — List File Stream contents from Google Drive


Recommended Posts

Setup


Set your Google Drive’s location in the Workflow’s Configuration.


Usage


Search the contents of your Google Drive via the gd keyword. Filter for folders only with gdf. Fallback Searches are included.


gd.png


gdfran.png

  • ↩: Open.
  • ⌥↩: Reveal in Finder.
  • ⇧↩: Search on Google Drive’s website.

You’ll be asked to build the cache on the first run. A notification will show when it’s ready. The more files you have, the longer the wait. A macOS launchd agent will be loaded to do it daily. An immediate cache rebuild can be forced with ⌘⌥⌃↩.


The Universal Actions make it straightforward to copy and move files to a Google Drive folder.


fileaction.png


To report a problem, run !gddiagnostic.


⤓ Install on the Alfred Gallery | Source

 

Edited by vitor
Link to comment

With recent versions of Google Drive, which switched to the macOS File Provider API, you may no longer need a workflow as Google Drive files may show up in regular Alfred searches. If you’re not seeing them, go into Alfred Preferences → Features → Default Results → Search Scope → Reset… (bottom right) and “Reset to Applications and Home”.

 

If you’re not yet on a Google Drive/macOS combination which allows that, or you prefer using the workflow for its granularity and want to report a problem, run !gddiagnostic and paste the results in this thread or on GitHub.


Note that to use the workflow you need to set up your Google Drive location in the Workflow’s Configuration. If you don’t know how to find your Google Drive, How-To Geek has the steps.

 

Edited by vitor
Link to comment
6 minutes ago, Appu Mohan said:

How to make it work for multiple accounts ?

 

On 9/9/2021 at 6:16 PM, vitor said:

The Workflow Environment Variables have defaults which will work for most people. You will only have to mess with them if you have an atypical setup.

  • google_drive_path: The location of Google Drive on your file system. Can take multiple paths separated by commas.

 

Link to comment
  • 2 weeks later...

Hi!

 

Many MANY thanks @vitor for offering such a workaround. This new Google Drive thing skipping such a central feature in my workflow sure pissed me off. I waited for the last moment praying this would be fixed but now I'm forced, I see that no 😕

So you just made me buy the powerpack just to use your workflow!  😅 (was already an Alfred user, but a free one).

As someone discovering the powerpack and first time workflow user, I was wondering initially where did I had to run the  ":gdrebuildcache or :gdlaunchd" commands, I tried in the Terminal at first.

 

But I'm not sure which one to choose as you're saying "or".

 

I did both and restarted my laptop, but it doesn't seem to work.

I only have one G Drive account.

Any clue on how to troubleshoot this?

 

Thanks!

1521276011_Capturedecran2021-10-01a13_48_29.thumb.png.55a37ba08cbd5352bf26c5e9ed8e235c.png

Link to comment
1 minute ago, Emal said:

I was wondering initially where did I had to run the  ":gdrebuildcache or :gdlaunchd" commands, I tried in the Terminal at first.

 

You run them in Alfred. In doubt, run the second. It will probably take a while to finish.

 

Welcome to the forums.

Link to comment

Thanks :)

Yeah I ended up figure this out, I also ran them both but how do I know it's been done properly?  

Oh, I see "A notification will be shown when done", I indeed never saw one. So I let it work in the background, but by "a while" you're thinking mere minutes or maybe 30 or 90?

Capture d’écran 2021-10-01 à 14.03.13.png

Link to comment

Run :gdlaunchd to disable it. If it’s already disabled, don’t do it. Restart your Mac. Open the debugger, set the log output to “All Information”, and run :gdrebuildcache. Wait for any error or the notification.

 

Also, provide the exact versions you have of Alfred, the Workflow, and macOS.

Link to comment

You need to keep waiting, not enough time has passed.

 

That error is unrelated but it also doesn’t make sense. Either you’ve changed something in the Workflow, or there’s something atypical about your system which I can’t check for.

Link to comment

Thanks so much for creating this Vitor. Work flow life saver – working really well for me on OS 11.6 and Alfred 4.5.1.

 

In case anyone else encounters this error:

[16:48:04.688] ERROR: Google Drive[Run Script] /Users/MyName/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1C049923-5A50-4A1B-BE98-4BC2A04C2F68/rebuild_cache:26:in 'atime': No such file or directory @ rb_file_s_atime - /Volumes/GoogleDrive/My Drive/<various subfolders>/r_m_24_d_2*_f127v.tif (Errno::ENOENT)

 

My guess is that it was some sort of sync error already occurring in Google Drive (maybe to do with the asterisk in the filename) – the file was visible on google drive but hadn't appeared in the streamed folder on my mac. I downloaded the file to the desktop, renamed it without the suspect symbol, deleted the old version from the google drive online to be sure and then added it back into the streamed directory so it resynced. After that, all of the steps in the script setup worked fine (about 25 mins to index 1.33 TB, in case that helps anyone as a time guide). 

 

Edited by Matt2B2
Link to comment
5 hours ago, Matt2B2 said:

Thanks so much for creating this Vitor. Work flow life saver – working really well for me on OS 11.6 and Alfred 4.5.1.

 

Glad to know!

 

6 hours ago, Matt2B2 said:

My guess is that it was some sort of sync error already occurring in Google Drive

 

I’ve inspected and was unable to reproduce. This does seem an error caused by Google Drive’s sync. Still, I’ve made a new release which would skip the file in the same situation.

 

6 hours ago, Matt2B2 said:

(about 25 mins to index 1.33 TB, in case that helps anyone as a time guide)

 

Appreciated! Number of files is a better indication than size, though. If you’d like to share that number, you can get it via (in a Terminal):

 

find '/Volumes/GoogleDrive/My Drive' | wc -l

Link to comment
On 10/6/2021 at 5:26 PM, vitor said:

Appreciated! Number of files is a better indication than size, though. If you’d like to share that number, you can get it via (in a Terminal):

 

 

find '/Volumes/GoogleDrive/My Drive' | wc -l

 

Thanks for this. It was about 25 mins to index 1.33 TB, comprised of 111467 files. 

Link to comment

Hi,

Didn't have time to get back to it until now. 

Reading the other comments, I'm wondering if there isn't an adaptation of the script needed if our computer is not set in English, like I am.

 

find '/Volumes/GoogleDrive/My Drive' | wc -l

didn't work for me, I had to adapt it to "Mon Drive" to make the command work.  (100711 files for me)

Would this explain why the WF didn't work?

I didn't dare edit anything in the script.

Capture d’écran 2021-10-08 à 17.26.43.png

Capture d’écran 2021-10-08 à 17.26.33.png

Link to comment

@Emal See the top post (or the Workflow’s README). You are supposed to change that /Volumes/GoogleDrive/My Drive path if your Google Drive is in a different location. That’s the default path but it’s in that location precisely so you can edit it. That would explain why it didn’t work for you before, yes.

Link to comment
On 10/8/2021 at 4:40 PM, vitor said:

@Emal See the top post (or the Workflow’s README). You are supposed to change that /Volumes/GoogleDrive/My Drive path if your Google Drive is in a different location. That’s the default path but it’s in that location precisely so you can edit it. That would explain why it didn’t work for you before, yes.

 

So, i must change "/Volumes/GoogleDrive/My Drive" to "/Volumes/Google Drive/O meu disco"?

Note: "Google Drive" has a space between Google and Drive. Do i mantain it?

Captura de ecrã 2021-10-14, às 11.17.13.jpg

Link to comment
22 minutes ago, gic said:

Note: "Google Drive" has a space between Google and Drive. Do i mantain it?

 

That’s Finder lying about the name. The actual volume is called GoogleDrive (no space). Double check by running ls /Volumes in a shell or entering /Volumes/ in Alfred.

 

Link to comment
4 hours ago, deanishe said:

 

That’s Finder lying about the name. The actual volume is called GoogleDrive (no space). Double check by running ls /Volumes in a shell or entering /Volumes/ in Alfred.

 

results this in alfred: "/volumes/Google Drive/O meu disco/"

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