vitor Posted September 9, 2021 Share Posted September 9, 2021 (edited) 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. ↩: 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. To report a problem, run !gddiagnostic. ⤓ Install on the Alfred Gallery | Source Edited April 29, 2023 by vitor Appu Mohan, Henry31, Kaske and 4 others 2 5 Link to comment
vitor Posted September 9, 2021 Author Share Posted September 9, 2021 (edited) 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 February 13, 2023 by vitor Link to comment
Appu Mohan Posted September 23, 2021 Share Posted September 23, 2021 Hi, It works well with my primary google account. How to make it work for multiple accounts ? Link to comment
vitor Posted September 23, 2021 Author Share Posted September 23, 2021 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. Appu Mohan 1 Link to comment
Emal Posted October 1, 2021 Share Posted October 1, 2021 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! Link to comment
vitor Posted October 1, 2021 Author Share Posted October 1, 2021 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
Emal Posted October 1, 2021 Share Posted October 1, 2021 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? Link to comment
vitor Posted October 1, 2021 Author Share Posted October 1, 2021 2 minutes ago, Emal said: So I let it work in the background, but by "a while" you're thinking mere minutes or maybe 30 or 90? Depends entirely on the amount of files you have. Link to comment
Emal Posted October 1, 2021 Share Posted October 1, 2021 Hi, It's been 3 hours now, is this supposed to be a possibility or something is wrong here? 115GB of files to be indexed. I can wait a full night if needed, but I feel like nothing happens, and I have no way of knowing it. @vitor Link to comment
vitor Posted October 1, 2021 Author Share Posted October 1, 2021 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
Emal Posted October 2, 2021 Share Posted October 2, 2021 Hi, thanks for this guidance. I did what you suggested. mac OS 11.5 Alfred 4.5.1 WF v2021.2 Link to comment
vitor Posted October 2, 2021 Author Share Posted October 2, 2021 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
Matt2B2 Posted October 6, 2021 Share Posted October 6, 2021 (edited) 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 October 6, 2021 by Matt2B2 Link to comment
vitor Posted October 6, 2021 Author Share Posted October 6, 2021 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
giovanni Posted October 6, 2021 Share Posted October 6, 2021 awesome work @vitor! Would it be possible to limit the output to folders, like in Alfred's Simple Folders Filter? e.g. gdf and typing query will return matching folders only. thanks!! Link to comment
vitor Posted October 7, 2021 Author Share Posted October 7, 2021 4 hours ago, giovanni said: Would it be possible to limit the output to folders Doing so would require a tradeoff, like a larger cache or slower cache build. Not worth it to make the Workflow worse for everyone for a niche request. giovanni 1 Link to comment
Matt2B2 Posted October 8, 2021 Share Posted October 8, 2021 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. vitor 1 Link to comment
Emal Posted October 8, 2021 Share Posted October 8, 2021 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. Link to comment
vitor Posted October 8, 2021 Author Share Posted October 8, 2021 @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
gic Posted October 14, 2021 Share Posted October 14, 2021 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? Link to comment
deanishe Posted October 14, 2021 Share Posted October 14, 2021 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
gic Posted October 14, 2021 Share Posted October 14, 2021 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
deanishe Posted October 14, 2021 Share Posted October 14, 2021 5 hours ago, gic said: results this in alfred: "/volumes/Google Drive/O meu disco/" Interesting. Mine is /Volumes/GoogleDrive, which is also the usual path, AFAIK. Link to comment
gic Posted October 15, 2021 Share Posted October 15, 2021 I tried everything and there is no way to make Google Drive — List File Stream contents from Google Drive operational. I Don't know what i'm doing wrong... Link to comment
vitor Posted October 15, 2021 Author Share Posted October 15, 2021 26 minutes ago, gic said: I Don't know what i'm doing wrong... Neither do we. You have to explain exactly what you’re doing to receive help. Preferably make a video. And please be sure to check Reporting Problems with Workflows beforehand. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now