Jump to content

Google Drive — List File Stream contents from Google Drive


Recommended Posts

@vitor, huge thanks for this workflow! I'm having trouble getting it to work, and wanted to see if you had any suggestions. 

 

I've installed the latest from Github, and ran the cache rebuilder and gdlaunchd. I fairly instantly received a notification saying the cache had been rebuilt. However, when I open alfred and type "gd", add a space and then my search terms, no results are ever returned. 

 

I have two Google accounts (one is my gmail, one is my work email, also a Google account). I only really care about trying to get results returned from my Shared Drive we use at work. I've synced all those files locally, but can't find them … or any files. Not when I search for files that are just in my normal Google Drive: 

 

1779874219_ScreenShot2021-10-15at10_03_09PM.thumb.png.a252adbbaa713c9a9f24687bdd879107.png

 

Or when I search for things in my Shared Drive: 

 

1683744294_ScreenShot2021-10-15at10_03_24PM.thumb.png.cfeaaa60de78013868d481ce0a7feab0.png

 

 

Any idea what I'm doing wrong? I saw references to adjusting the paths, but couldn't figure out how to do that, or if that was relevant. My Google Drives should be in the default locations though. 

Link to comment
6 hours ago, egoldin said:

Any idea what I'm doing wrong?

 

Please don't post screenshots like that. We can't tell you what's going wrong from screenshots of a workflow doing nothing any more than a mechanic can look at a photo of your parked car and tell you why it won't start.

 

Look in the workflow debugger to see what Alfred/the workflow say.

 

6 hours ago, egoldin said:

couldn't figure out how to do that

 

Workflow Environment Variables in the workflow's configuration sheet.

Link to comment

Hello @vitor,

for several weeks your workflow isn't working for me. Today, I take the time and removed the old Google Drive Workflow from Alfred.

 

I installed the new workflow from your thread here.

- Google Drive Workflow Version: v2021.4

- Alfred Version: 4.6 [1266] 

- MacOS Version: Big Sur (11.6)

 

After enabling the Agent:

[11:09:17.099] Google Drive[Script Filter] Queuing argument ''
[11:09:17.167] Google Drive[Script Filter] Script with argv '' finished
[11:09:17.168] Google Drive[Script Filter] {"items": [
      {
        "title": "Install Google Drive launchd service",
        "subtitle": "Save a cache of added files whenever /Users/henryauffahrt/henry.auffahrt@aufbau.online - Google Drive is modified",
        "arg": "install"
      },
    ]}
[11:09:18.036] Google Drive[Script Filter] Processing complete
[11:09:18.038] Google Drive[Script Filter] Passing output 'install' to Run Script
[11:09:18.281] Google Drive[External] Processing complete
[11:09:18.283] Google Drive[External] Passing output '' to Run Script

PS: I also tried this path: /Users/henryauffahrt/Google Drive - AufBau.

 

I do not see a message like "all done" popping up for several minutes.

 

If I search something, I get the following message:

[11:13:37.146] Google Drive[Script Filter] Queuing argument 'chocolat'
[11:13:37.287] Google Drive[Script Filter] Script with argv 'chocolat' finished
[11:13:37.288] Google Drive[Script Filter] {"items":[{"title":"Run :gdrebuildcache or :gdlaunchd","subtitle":"The former will rebuild the cache file once while the latter will rebuild it every day","valid":false}]}

 

What do you mean with "The former"? Is the indexing process is still in progress?

 

I tried to rebuild the cache with the :gdrebuildcache command

[11:14:34.158] Google Drive[Keyword] Processing complete
[11:14:34.159] Google Drive[Keyword] Passing output '' to Arg and Vars
[11:14:34.160] Google Drive[Arg and Vars] Processing complete
[11:14:34.161] Google Drive[Arg and Vars] Passing output '' to Run Script

 

Passing output '' ← Could the blank output be a problem here?

 

I also read your comment in the script for the :gdlaunchd

# Set correct directory to watch
# Current method might not be robust enough
# if there are characters in the path which need escaping

 

So I tried some other pathes like:

  • /Users/henryauffahrt/Google Drive - AufBau/My Drive
  • /Users/henryauffahrt/Google Drive - AufBau/Shared drvies
  • /Users/henryauffahrt/Google Drive - AufBau
  • /Users/henryauffahrt/Google Drive - AufBau/
  • "/Users/henryauffahrt/Google Drive - AufBau" ← Here I get an error output: [11:18:53.931] ERROR: Google Drive[Run Script] Google Drive path does not exist!
  • '/Users/henryauffahrt/Google Drive - AufBau' ← Same as above, thanks for this good error handling

After changing the path I run :gdrebuildcache and I got the following message:

[11:22:17.718] Google Drive[Keyword] Processing complete
[11:22:17.719] Google Drive[Keyword] Passing output '' to Arg and Vars
[11:22:17.720] Google Drive[Arg and Vars] Processing complete
[11:22:17.720] Google Drive[Arg and Vars] Passing output '' to Run Script
[11:22:17.954] ERROR: Google Drive[Run Script] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `initialize': table main already exists (SQLite3::SQLException)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `new'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:91:in `prepare'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0/gems/sqlite3-1.3.13/lib/sqlite3/database.rb:137:in `execute'
	from /Users/henryauffahrt/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.5665891C-6430-468E-97FC-80D87DD7B501/rebuild_cache:24:in `<main>'

 

Sorry If I might get it wrong, but with 'initialize' it means that the indexing process is still going on? May I'm not patient enough?

 

Thanks a lot for your help again, I don't know how to make it up to you 😅

Link to comment
On 10/21/2021 at 2:34 PM, vitor said:

 

Yes. You’re running the commands multiple times and making them trample each other.

 

On 10/22/2021 at 3:26 AM, vitor said:

New release is out. It expands gd to differentiate between cache missing or being built and prevents immediate sequential cache rebuilds.

 

Thanks a lot for clarifying, and also for the new release.


I installed everything on the mac of my colleague and after a while the index was built up and everything works fine for him. For me, on my mac, after 24h it was not working, the index seems not to built up correctly.

But now I get it to work, this is how I did it:

  1. Make sure the index agent is disabled
  2. Deleted your workflow
  3. Restarted by Mac
  4. Reinstalled your workflow new
  5. enabled the index agent
  6. after a while the index was built up, everything works 🎉

Thanks a lot for your work @vitor!!

 

 

Link to comment
On 10/16/2021 at 12:15 PM, deanishe said:

 

Please don't post screenshots like that. We can't tell you what's going wrong from screenshots of a workflow doing nothing any more than a mechanic can look at a photo of your parked car and tell you why it won't start.

 

Look in the workflow debugger to see what Alfred/the workflow say.

 

 

Workflow Environment Variables in the workflow's configuration sheet.

 

Sorry about that @deanishe! I thought those screenshots would be helpful, but I now realize the debugger would be a lot more helpful. On that note, I used the debugger and thanks to @vitor's updates, it looks like the issue is that the Google Drive Path does not exist (screenshot attached).

 

I don't think I've ever modified/customized my Google Drive Path, but I just noticed when I open the "Configure variables" settings for this workflow, I see the workflow is set to [redacted path]. Should I change that to my Mac username? I'm just trying to search my Shared Drives on my work Google Drive — and I've set all shared drives/files to sync locally/be available for offline access. 

 

Attached [redacted screenshot] showing file path to those shared drives, in case that's helpful. (Can delete if it's a bad idea to share my emails). 

 

Thanks for your help!

 

 

 

Edited by vitor
Redacted semi-personal info
Link to comment

That is a test path which has never made it into any official release of this Workflow. I know because I just rechecked them all.

 

I have no idea how you got into that situation. Delete the Workflow and make sure to get it from the top post on this thread.

 

Also, before posting about any issues please be sure to follow the second post of this thread.

Edited by vitor
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...