Jump to content

Google Drive — List File Stream contents from Google Drive


Recommended Posts

  • 1 month later...

@vitor I'm sorry to bother you, but I've been having an issue with the workflow since my computer died recently and was returned by Apple rebuilt and I can't figure out what's going on. I have used this workflow on many computers for years and years but am stumped at this time.

 

Fresh install of Ventura. Granted full access to Alfred. Installed and configured to my drive folder. I've tried it both with local paths (I generally don't store local copies) and the CloudStorage path as well. 

 

None of my files are visible when triggered by "gd" followed by a term and I can't seem to initiate a cache rebuild, the only thing that is visible is a folder named "GoogleDrive-myemailaddress".

 

When I do search for any term after gd a new tab is opened with the results of the search, they just aren't visible in Alfred.

 

For whatever reason, the option just doesn't work whether I search using "gd whatever +fn +return" or "gd whatever +control +option +command +return" per the instructions (both original and updated version). I've also checked to make sure my globe/fn key didn't somehow default to another operation or something. I wish there was a text command that we could give to rebuild the cache.

 

Here's what's given with the diagnostic tool (first section) and what was being thrown in the debugger mode.

 

I'm hoping it's just something obvious I'm overlooking after a long day.

 

Thanks in advance.

 

=============

 

DIAGNOSTIC OUTPUT:

 

### Workflow version
2023.8

### Alfred version
5.1.4

### macOS version
13.5

### Architecture
arm64

### Preferences
Dict {
    google_drive_path = ~/Library/CloudStorage/GoogleDrive-xyz.abc@c.org
}

### Full Disk Access
Granted

### Google drive path
Exists: /Users/phil/Library/CloudStorage/GoogleDrive-xyz.abc@c.org
831 paths

### Cache dir
cache.db

### Cache file
16777232 1208976 -rw-r--r-- 1 phil staff 0 8192 "Nov  7 10:06:47 2023" "Nov  6 20:10:14 2023" "Nov  6 20:10:14 2023" "Nov  6 20:10:14 2023" 4096 16 0 /Users/phil/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

 

========


DEBUGGER RESPONSE:

 

[18:54:51.668] Google Drive[Script Filter] Queuing argument 'q'
[18:54:51.846] Google Drive[Script Filter] Script with argv 'q' finished
[18:54:51.851] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “q” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"q"}]}
[18:54:53.585] Google Drive[Script Filter] Queuing argument 'qs'
[18:54:53.759] Google Drive[Script Filter] Script with argv 'qs' finished
[18:54:53.764] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “qs” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"qs"}]}
[18:54:54.479] Google Drive[Script Filter] Queuing argument 'qss'
[18:54:54.656] Google Drive[Script Filter] Script with argv 'qss' finished
[18:54:54.661] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “qss” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"qss"}]}
[18:55:10.328] Google Drive[Script Filter] Queuing argument 'q'
[18:55:10.510] Google Drive[Script Filter] Script with argv 'q' finished
[18:55:10.517] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “q” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"q"}]}
[18:55:10.933] Google Drive[Script Filter] Queuing argument 'qs'
[18:55:11.081] Google Drive[Script Filter] Queuing argument 'qss'
[18:55:11.108] Google Drive[Script Filter] Script with argv 'qs' finished
[18:55:11.113] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “qs” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"qs"}]}
[18:55:11.243] Google Drive[Script Filter] Script with argv 'qss' finished
[18:55:11.249] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “qss” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"qss"}]}
[18:55:12.730] Google Drive[Script Filter] Processing complete
[18:55:12.732] Google Drive[Script Filter] Passing output 'qss' to Conditional
[18:55:12.734] Google Drive[Conditional] Processing complete
[18:55:12.735] Google Drive[Conditional] Passing output 'qss' to Open URL
[18:55:12.754] Google Drive[Open URL] Processing complete
[18:55:12.764] Google Drive[Open URL] Passing output '(
    "https://drive.google.com/drive/u/0/search?q=qss"
)' to Run Script
[18:55:19.711] Google Drive[Script Filter] Queuing argument 'q'
[18:55:19.901] Google Drive[Script Filter] Script with argv 'q' finished
[18:55:19.911] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “q” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"q"}]}
[18:55:20.001] Google Drive[Script Filter] Queuing argument 'qs'
[18:55:20.158] Google Drive[Script Filter] Queuing argument 'qss'
[18:55:20.165] Google Drive[Script Filter] Script with argv 'qs' finished
[18:55:20.167] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “qs” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"qs"}]}
[18:55:20.300] Google Drive[Script Filter] Script with argv 'qss' finished
[18:55:20.308] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “qss” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"qss"}]}
[18:55:20.696] Google Drive[Script Filter] Queuing argument 'qss '
[18:55:20.868] Google Drive[Script Filter] Script with argv 'qss ' finished
[18:55:20.878] Google Drive[Script Filter] {"items":[{"variables":{"action":"search_website"},"title":"Search “qss ” on Google Drive’s website","icon":{"path":"icon.png"},"arg":"qss "}]}
[18:55:23.879] Google Drive[Script Filter] Processing complete
[18:55:23.881] Google Drive[Script Filter] Passing output 'qss ' to Conditional
[18:55:23.883] Google Drive[Conditional] Processing complete
[18:55:23.884] Google Drive[Conditional] Passing output 'qss ' to Open URL
[18:55:23.902] Google Drive[Open URL] Processing complete
[18:55:23.903] Google Drive[Open URL] Passing output '(
    "https://drive.google.com/drive/u/0/search?q=qss%20"
)' to Run Script
 

 

 

Link to comment
  • 2 weeks later...
On 11/8/2023 at 1:43 AM, vitor said:


Delete that file and try again.

 

One follow-up please. I'm having trouble with my team drive.

 

The cache rebuilt perfectly for my personal shared drive, but not for the shared folder drive path for my organization's shared drive. I did not receive any errors during the rebuild phase (though I did originally with an errant ~ several times, but that went away with the corrected path).

 

Nevermind, I figured it out. I decided to force a restart this time after deleting the cache file, but before trying to rebuild the cache. Then, I rebuilt the cache and it seems to be working as designed.

 

Several attempts to simply delete the cache file and rebuild did not work, but restarting did.

 

Edited by eyesunderground
Fixed the problem
Link to comment

Hi @vitor thank you for building this amazing workflow and it really helps a lot 🙏🏻

 

A few questions to ask... 


1) I tried :gdrebuildcache and seems it never shows the correct instruction in Alfred (screenshot below). 
    If possible could you guide a bit on which setting I was doing wrong.

image.thumb.png.fd2e4e63ac7bddfd495522c0d0ee8981.png

 

 

2) Is there a way to have the cache file auto-rebuilding itself..? 
    * it was working flawlessly on Alfred 4, but when migrating to Alfred 5 seems the cache building has some small problem.

    * the way I currently work is to manually enter the cache file and delete the file and force the workflow to rebuild again (enter "user/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/com.alfredapp.vitor.googledrive and delete cache file) 

 

Thank you again for your reply in advance. 

 

Below is my !gddiagnostic log

 

### Workflow version

2023.8

 

### Alfred version

5.1.4

 

### macOS version

11.7

 

### Architecture

arm64

 

### Preferences

Dict {

    dir_search_keyword = ff

    google_drive_path = /Volumes/GoogleDrive-116708284347294937811/Other computers/My MacBook Air 2019 Intel/Customer

}

 

### Full Disk Access

NOT granted

 

### Google drive path

Exists: /Volumes/GoogleDrive-116708284347294937811/Other computers/My MacBook Air 2019 Intel/Customer

8441 paths

 

### Cache dir

cache.db

 

### Cache file

16777232 74268530 -rw-r--r-- 1 pj-1 staff 0 1916928 "Nov 27 23:13:28 2023" "Nov 27 23:11:35 2023" "Nov 28 09:23:48 2023" "Nov 27 23:11:06 2023" 4096 4224 0 /Users/pj-1/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 lovemedance
Link to comment
9 hours ago, lovemedance said:

I tried :gdrebuildcache


That has changed to a shortcut.

 

9 hours ago, lovemedance said:

Is there a way to have the cache file auto-rebuilding itself..?


That’s already how it works, and always has.

 

Both of those are covered in the instructions:

 

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

A macOS launchd agent will be loaded to do it daily. An immediate cache rebuild can be forced with ⌘⌥⌃↩.

 

Also, you need to grant Full Disk Access, as @Stephen_C pointed out.

Link to comment

Thank you @Stephen_C.

 

Thank you @vitor

 

*I had enabled full disk access and waiting it to be rebuild now.

 

*Just one thing , in order to do a immediate cache rebuild with shortcut  " ⌘⌥⌃↩" ,

I am sorry but I do not know how to execute this command. 

Should I open Alfred -> and type gd as prefix -> and click the combo ⌘⌥⌃↩ keys as the command ? 

 

Thank you for answering the question in advance.. 🙏🏻

 

Screen Shot 2023-11-29 at 5.33.52 PM.png

Link to comment

After enable full disk access ,

seems the cache building is not running as expected..

here is the log below FYI. 

 

 

Below is my !gddiagnostic log (runs on Dec/5th today)

 

 

### Workflow version

2023.8

 

### Alfred version

5.1.4

 

### macOS version

11.7

 

### Architecture

arm64

 

### Preferences

Dict {

    dir_search_keyword = ff

    google_drive_path = /Volumes/GoogleDrive-116708284347294937811/Other computers/My MacBook Air 2019 Intel/Customer,/Volumes/GoogleDrive-116708284347294937811/Other computers/My MacBook Air 2019 IntelPersonal_Project

}

 

### Full Disk Access

Granted

 

### Google drive path

Exists: /Volumes/GoogleDrive-116708284347294937811/Other computers/My MacBook Air 2019 Intel/Customer

8503 paths

Does NOT Exist: /Volumes/GoogleDrive-116708284347294937811/Other computers/My MacBook Air 2019 IntelPersonal_Project

 

### Cache dir

cache.db

 

### Cache file

16777232 74268530 -rw-r--r-- 1 pj-1 staff 0 1916928 "Nov 27 23:13:28 2023" "Nov 27 23:11:35 2023" "Nov 28 09:23:48 2023" "Nov 27 23:11:06 2023" 4096 4224 0 /Users/pj-1/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

Link to comment
  • 2 months later...

Hello! I'm having troubles with the "Copy to..." and "Move to..." universal actions with this workflow. I'm able to see files just fine by searching, but the universal actions don't work (see Workflow Log). When I look at the debugger, the output shows nothing being passed on to the script. I ran the diagnostics, and it seems like everything is good there (Debug Results), so I'm not sure what to do from here. Any help would be greatly appreciated. Thank you!

Debug Results.png

Workflow Log.png

Link to comment
1 hour ago, vitor said:

There’s nothing wrong with that log, it’s working as intended. When it reaches the Script Filter, you have to type something to search for folders in your drive to move to.

Sorry, I forgot to mention: as soon as I select the Move to Google Drive action, Alfred’s window just disappears. It doesn’t remain for me to type folders in. 

Link to comment
  • 2 weeks later...

I kept reading about how to rebuild the cache but the comments were'nt very clear, then I figured it out so maybe this will help someone else.

 

1. Open Alfred

2. type gd and just 2-3 letters (generally any letters will work)

3. Once you see some results, just press ⌘⌥⌃ on your keyboard and you should see the text under the first/highlighted result change to "Force Cache Update"

4. With those keys held, just hit ↩ (return) on your keyboard to start the process

 

Note: If you type more than 3 letters and Alfred says, "Search "blah" on Google Drive's website", you've entered too much and it won't work.

 

step1.png

step2.png

Link to comment
  • 2 months later...
On 9/9/2021 at 10:24 AM, vitor said:

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.

 

This worked for me! Thank you so much!

Link to comment

Updated to 2024.1.

  • Change Folder separator from comma to colon.
  • Use Number Slider for result limit and increase to 200.
  • Do not close window on Fallbacks, Copy, Move.
  • Skip Input as Universal Action.

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