Jump to content

Google Drive — List File Stream contents from Google Drive


Recommended Posts

Help! Alfred 5 won't rebuild cache on my Google Drive anymore, and when I search for items in there no thumbnails and I can't click on anything. Can't run :gdrebuildcache as it just says "Be Patient!"

 

When I run !gddiagnostic, I get nothing copied to my clipboard.

 

Screenshot of my device attached, running MacOS 13.1 (22C65)

image.png.6bbfac73cf5bbf0dbf95bf2e227c10e4.png

Link to comment

Welcome @FlowVideo,

 

first make sure you’re on the right version.
 

Then make sure your Google Drive really is pointing at the right place, because Google has been changing that.

 

Then restart and try the diagnostic command gain, and be patient with it. How many files do you have in Google Drive?

 

Alternatively, you may now be able to access the Google Drive files without the workflow, so try that too.

Link to comment

I turned on my computer from sleep and saw about 5 dialog boxes showing me that the diagnostics had been copied to the clipboard (many hours later), and apparently also the gd cache had rebuilt since I'm now able to use it again!

 

Below I paste the diagnostics:

 

### Workflow version
2022.23

### Alfred version
5.0.6

### macOS version
13.1

### Architecture
i386

### Preferences
Dict {
    google_drive_path = ~/Library/CloudStorage/*****@*****.tld/My Drive
}

### Full Disk Access
Granted

### Google drive path
Exists: /Users/justinwedes/Library/CloudStorage/*****@*****.tld/My Drive
261327 paths

### Cache dir
Files NOT present

### Cache file
Does NOT exist

### Temporary cache
Does NOT exist

### Build progress
NOT running

### Launchd job
Loaded: -    0    com.alfredapp.vitor.googledrive
Installed
 

Link to comment
On 2/10/2023 at 6:52 PM, vitor said:

What exactly do you get in the debugger when running :gdrebuildcache?

 

And what do you get if you run find "GOOGLE DRIVE PATH HERE" | wc -l | tr -d ' \n' in a Terminal?

 

Hi @vitor

 

debugger output of :gdrebuildcache:

[10:35:31.289] Logging Started...
[10:35:36.786] Google Drive[Keyword] Processing complete
[10:35:36.789] Google Drive[Keyword] Passing output '' to Run Script
[10:35:36.869] Google Drive[Run Script] Processing complete
[10:35:36.874] Google Drive[Run Script] Passing output '' to Run Script

 

And the find command never responds (until I ^C it), which is the reason why I removed it from the !gddiagnostics script ^^

 

IMHO, the problem is not on your side, but on Google one : their new way to store files may be buggy?

To be noticed : I have a huge drive (more than 200TB of files, with a lot of small files shared to me ... could it be that I reached an hidden limitation?

 

Seems that @FlowVideo has got the exact same problem, as the symptoms are very similar.

 

I wish I could go back to an older version of GDrive 🙄

 

Thanks a lot for your time!

Link to comment
3 hours ago, dam75 said:

To be noticed : I have a huge drive (more than 200TB of files, with a lot of small files shared to me ... could it be that I reached an hidden limitation?

 

If you have deep nesting, you may have reached the maximum path length. But it seems more likely that the command hasn’t stalled, it’s just taking a long time because you have so many files.


Try with the regular indexing, without the workflow.

Link to comment
On 2/13/2023 at 2:27 PM, vitor said:

 

If you have deep nesting, you may have reached the maximum path length. But it seems more likely that the command hasn’t stalled, it’s just taking a long time because you have so many files.

Maybe, but the weird thing is that with the old version of Google Drive, it worked perfectly ... and I prefer a lot your workflow to the native search ^^

Anyway, many thanks for your work and your time, it's precious!

Link to comment

Updated to 2023.4.

  • Removed keyword to force rebuild cache. Now available with fn↩
  • Fixed paths in diagnostic.
  • Made launchd agent self-clean when trigger not found. To get this if you already have the workflow:
    1. Disable Periodic Refresh in configuration.
    2. Save.
    3. Use the workflow to open a file or reveal it in Finder.
    4. Enable Periodic Refresh.
    5. Save.

Note the above is not a requirement. The old agent was already pretty efficient so even leaving it there won’t make a noticeable difference.

Link to comment
On 2/24/2023 at 4:09 PM, vitor said:
  • Removed keyword to force rebuild cache. Now available with fn↩

In case anybody else is confused, it's necessary to enter a query or partial query after the keyword before invoking this command.  For instance, 'gd [something]' and then pressing fn+↩ will work.  

 

If you don't type something after 'gd', nothing will happen when you press fn+↩.

 

Maybe this will be obvious to others, but it wasn't for me.

Link to comment

I'm trying to get Google Drive indexing to work for me. I'm on macOS 13.3.

 

Example case: I have thousands of song files in various formats (text, PDF, PowerPoint, etc.) in a folder structure. If I do a Spotlight search on a local copy of that folder structure for a word, let's say "wondrous," I get 185 hits from filenames and file contents. If I do a Spotlight search on that same folder structure in the Google Drive folder, I get zero hits -- even though that folder is tagged as "available offline" in Google Drive settings. If I login to Google Drive in a web browser and do the same search, I get 112 hits. If I use "gd wondrous" in Alfred (5.0.6 with Google Drive workflow v2023.6), I get 20 hits.

 

 

### Workflow version
2023.6

### Alfred version
5.0.6

### macOS version
13.3

### Architecture
arm64

### Preferences
Dict {
    google_drive_path = ~/Library/CloudStorage/GoogleDrive-jon@cardioquip.com
}

### Full Disk Access
Granted

### Google drive path
Exists: /Users/jon/Library/CloudStorage/GoogleDrive-jon@cardioquip.com
165764 paths

### Cache dir
cache.db

### Cache file
16777232 183443887 -rw-r--r-- 1 jon staff 0 42512384 "Mar 29 13:29:28 2023" "Mar 29 13:28:07 2023" "Mar 29 13:28:07 2023" "Mar 29 13:26:53 2023" 4096 84008 0 /Users/jon/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.googledrive/cache.db

### Temporary cache
Does NOT exist

### Build progress
NOT running

### Launchd job
Loaded: -    0    com.alfredapp.vitor.googledrive
Installed
 

Edited by jlgtx
Link to comment
  • 2 weeks later...

Excellent and very useful workflow. Thank you. I've set it to a Photo management app that I use called Stockpile so that I can search for photos inside the app (it works with Apple Photos too, but because Photos gives them numbered titles it's impossible to know what to search for). I'm wondering if there's a way to create further search options that go beyond just the name of the file? I've been learning the terminal and unix commands and looking into how to write scripts, but it's beyond me for now. I'd like to be able to search by User Tag as well as by title if that's possible.

Link to comment
  • 2 weeks later...

This started with my new mac, I am on v2023.4, some files are simply not found, and also sometimes when found hitting return will not open them.  I tried to rebuild the cache and nothing happens.  Any help appreciated.  On 13.2.1 on Apple M2 Max.

 

running !gddiagnostic  which says the results will be copied to the clipboard doesn't seem to do anything.  Thanks.

Link to comment
1 minute ago, jgla said:

running !gddiagnostic  which says the results will be copied to the clipboard doesn't seem to do anything.

 

It copies information to your clipboard. Paste it here. Without that information it is impossible to proceed.


If nothing is copied, check the debugger.


But before all that, update the workflow. You’re two versions behind.

Link to comment

The significant problem appears to be that you've not given Alfred permission to use full disk access (System Settings → Privacy & Security then click on Full Disk Access).

 

Edit: Go to Alfred Preferences → General and click on Request Permissions….

 

Stephen

Edited by Stephen_C
Link to comment

In the new version of ventura, it seems that is handled differently, nothing on my machine is granted full disk access (not google drive which is working fine), can you confirm that with Ventura I need to give full disk access

Screenshot 2023-04-22 at 9.23.02 AM.png

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