azai91 Posted August 4, 2015 Share Posted August 4, 2015 (edited) Browse, search and open Google Drive files from within Alfred. Get the workflow from Packal or Github URL. This workflow searched your google drive and opens the files in your browser. They keyword is "d" (example d alfred). With enter you can open the entry in your default browser. You have to login (d > login) before you can use the workflow. The login uses OAuth, so you do not need to enter your credentials. Please leave issues if you encounter any problems or star this repo if you found it useful Edited April 27, 2016 by azai91 TFV and azai91 2 Link to comment
xilopaint Posted August 4, 2015 Share Posted August 4, 2015 It's not working for me on 10.11 beta. Link to comment
fuska Posted August 4, 2015 Share Posted August 4, 2015 Thanks azai91, At first I couldn't use the login command, but I realised I have to install the Google oauth API. So I run this command from terminal: easy_install --upgrade google-api-python-client Now, after allowing access from Google I get redirected to http://localhost:3000but I get a connection refused error page. I'm guessing the server didn't start properly. Can you help us here? Thanks again thec13 1 Link to comment
40-02 Posted August 8, 2015 Share Posted August 8, 2015 I have problem too: Starting debug for 'Google Drive' [STDERR: alfred.workflow.input.scriptfilter] 23:37:58 workflow.py:2250 WARNING Can't save last version: workflow has no version 23:37:58 workflow.py:2106 DEBUG Workflow finished in 0.003 seconds. [ERROR: alfred.workflow.action.script] Traceback (most recent call last): File "./server.py", line 1, in <module> from flask import Flask, request ImportError: No module named flask 23:38:06 workflow.py:2250 WARNING Can't save last version: workflow has no version 23:38:06 workflow.py:2106 DEBUG Workflow finished in 0.330 seconds. Link to comment
deanishe Posted August 11, 2015 Share Posted August 11, 2015 (edited) Browse, search and open Google Drive files from within Alfred. Get the workflow from Packal or Github URL. This workflow searched your google drive and opens the files in your browser. They keyword is "d" (example d alfred). With enter you can open the entry in your default browser. You have to login (d > login) before you can use the workflow. The login uses OAuth, so you do not need to enter your credentials. Would you consider installing all your workflow's dependencies in the workflow as described here (like you did with Alfred-Workflow)? It's difficult for less technically-inclined users to install Python libraries (and nobody uses easy_install), and it's a fundamentally bad idea to install libraries in the system Python: there's a good chance you'll break some software because Python can't handle multiple version of the same library, and the libraries may disappear on a system upgrade. If a user syncs their workflows between machines, they also have to install the libraries for each machine. If you include all the libraries your workflow needs in the workflow itself, it "just works". Edited August 11, 2015 by deanishe Link to comment
fuska Posted August 11, 2015 Share Posted August 11, 2015 Thanks deanishe, It would be great if the libraries were already included. First of all, I don't have a clue what I'm doing, just a couple searches on Google. Until it get fixed, I got this working using the following command: sudo pip install flask (Use at your own risk) Link to comment
deanishe Posted August 11, 2015 Share Posted August 11, 2015 sudo pip install flask Yeah, that's not such a great idea. You'd be better off opening the workflow in Terminal and using pip install --target . flask to install the library in the workflow. Flask probably won't cause much trouble, as its API is pretty stable, but it's generally not a great idea to install any libraries in the system Python. If you must, use pip install --user <libname> (without "sudo"). That will install them under your own home directory, where they won't go missing during a system upgrade. thec13 1 Link to comment
azai91 Posted August 25, 2015 Author Share Posted August 25, 2015 Sorry for the late response. Launched an update that should address most issues with the workflow. Let me know if there are any bugs - I'm going to be on top of this thread more. Link to comment
xilopaint Posted August 25, 2015 Share Posted August 25, 2015 Sorry for the late response. Launched an update that should address most issues with the workflow. Let me know if there are any bugs - I'm going to be on top of this thread more. Still not working for me. Link to comment
azai91 Posted August 25, 2015 Author Share Posted August 25, 2015 Did you redownload the latest version on Packal (0.2)? What happens when you try to login? Link to comment
xilopaint Posted August 25, 2015 Share Posted August 25, 2015 Did you redownload the latest version on Packal (0.2)? What happens when you try to login? [ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last): File "drive.py", line 3, in <module> from oauth2client.client import OAuth2WebServerFlow ImportError: No module named oauth2client.client Link to comment
deanishe Posted August 25, 2015 Share Posted August 25, 2015 You don't have the Python libraries the workflow requires installed. As noted above, if azai91 bundled the libraries with the workflow, these problems wouldn't happen. Link to comment
wandering Posted September 4, 2015 Share Posted September 4, 2015 (edited) Should be a great workflow! It finds my google drive-files flawlessly. But when hitting return-key; nothing happens. The browser (safari or chrome) is not launched.... Any ideas on how to solve this? Update: Stupid, I installed the "easy_install --upgrade google-api-python-client", now it redirects to Localhost and i also get the 500 internal server error. Edited September 4, 2015 by realbase Link to comment
azai91 Posted October 6, 2015 Author Share Posted October 6, 2015 Made some edits to make more stable. Please check out the new version on github. Also, feel free to submit issues on github! azai91 1 Link to comment
azai91 Posted October 15, 2015 Author Share Posted October 15, 2015 Made some additional edits! Check out the new version on packal! Link to comment
azai91 Posted October 24, 2015 Author Share Posted October 24, 2015 Hey everybody, Please leave me feedback if there are any more bugs / cools features you think I should add! Link to comment
xilopaint Posted October 27, 2015 Share Posted October 27, 2015 Hey everybody, Please leave me feedback if there are any more bugs / cools features you think I should add! Still not working for me. Link to comment
Samelot Posted November 3, 2015 Share Posted November 3, 2015 (edited) Quote Still not working for me. @xilopaint, check out this issue on github: https://github.com/azai91/alfred-drive-workflow/issues/2 These were my steps to fix the issue and login and be able to be able to browse through my google drive: 1. Download latest version here: http://www.packal.org/workflow/google-drive 2. Browse to the Alfred workflow directory in finder and go inside the google drive workflow (you'll which one it is when you see files drive_api.py or drive_launcher.py) 3. Find and open drive_launcher.py in a text editor 4. Replace with this code: import subprocess import sys from drive_api import Drive from workflow import Workflow def main(wf): url = wf.args[0] if url in 'logout': return Drive.delete_credentials() elif url[:5] in 'login': return Drive.open_auth_page() Drive.open_page(url) if __name__ == '__main__': wf = Workflow() sys.exit(wf.run(main)) Edited June 24, 2019 by deanishe Replace real name Link to comment
deanishe Posted November 4, 2015 Share Posted November 4, 2015 That's a weird way of comparing strings. You should definitely be using elif url.startswith('login'): and the other check should probably read if url == 'logout': Link to comment
xilopaint Posted November 7, 2015 Share Posted November 7, 2015 (edited) On 11/3/2015 at 12:34 PM, Samelot said: Peba, check out this issue on github: https://github.com/azai91/alfred-drive-workflow/issues/2 These were my steps to fix the issue and login and be able to be able to browse through my google drive: 1. Download latest version here: http://www.packal.org/workflow/google-drive 2. Browse to the Alfred workflow directory in finder and go inside the google drive workflow (you'll which one it is when you see files drive_api.py or drive_launcher.py) 3. Find and open drive_launcher.py in a text editor 4. Replace with this code: import subprocess import sys from drive_api import Drive from workflow import Workflow def main(wf): url = wf.args[0] if url in 'logout': return Drive.delete_credentials() elif url[:5] in 'login': return Drive.open_auth_page() Drive.open_page(url) if __name__ == '__main__': wf = Workflow() sys.exit(wf.run(main)) I've just read the thread on GitHub where azai91 tells the latest workflow version reflects these changes. After downloading it, I still have the login issue. Edited June 22, 2019 by xilopaint Link to comment
azai91 Posted December 2, 2015 Author Share Posted December 2, 2015 Released a new update. If you are having any issues, please leave issues on github or this thread. I find this workflow incredibly useful and would love to get it working for as many people as possible. Link to comment
xilopaint Posted December 2, 2015 Share Posted December 2, 2015 (edited) On 12/2/2015 at 7:49 PM, azai91 said: Released a new update. If you are having any issues, please leave issues on github or this thread. I find this workflow incredibly useful and would love to get it working for as many people as possible. When tried to login I got this debugging log: [STDERR: alfred.workflow.input.scriptfilter] 20:00:19 workflow.py:2140 DEBUG Workflow version : 0.7.0 20:00:19 workflow.py:1543 DEBUG Reading settings from `/Users/xyz/Library/Application Support/Alfred 2/Workflow Data/com.drive.azai91/settings.json` ... 20:00:19 workflow.py:2401 DEBUG Update check not due 20:00:19 workflow.py:1778 DEBUG Loading cached data from : /Users/xyz/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.drive.azai91/__workflow_update_status.cpickle 20:00:19 workflow.py:2349 DEBUG update_data : {u'available': False} 20:00:19 drive_api.py:92 ERROR spawning new 20:00:19 drive_api.py:95 ERROR spawning new seRIOUSl 20:00:19 background.py:188 DEBUG Command arguments cached to `/Users/xyz/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.drive.azai91/drive_refresh.argcache` 20:00:19 background.py:192 DEBUG Calling [u'/usr/bin/python', '/Users/xyz/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.ED4A6D1E-609F-4872-8089-74D90EE3E2EC/workflow/background.pyc', 'drive_refresh'] ... 20:00:19 workflow.py:2140 DEBUG Workflow version : 0.7.0 20:00:19 workflow.py:2176 DEBUG Workflow finished in 0.026 seconds. 20:00:19 workflow.py:2176 DEBUG Workflow finished in 0.029 seconds. 20:00:19 background.py:197 DEBUG Executing task `drive_refresh` in background... 20:00:19 workflow.py:2331 DEBUG Set last run version : 0.7.0 20:00:19 workflow.py:2176 DEBUG Workflow finished in 0.138 seconds. [STDERR: alfred.workflow.input.scriptfilter] 20:00:25 workflow.py:2140 DEBUG Workflow version : 0.7.0 20:00:25 workflow.py:1543 DEBUG Reading settings from `/Users/xyz/Library/Application Support/Alfred 2/Workflow Data/com.drive.azai91/settings.json` ... 20:00:25 workflow.py:2401 DEBUG Update check not due 20:00:25 workflow.py:1778 DEBUG Loading cached data from : /Users/xyz/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.drive.azai91/__workflow_update_status.cpickle 20:00:25 workflow.py:2349 DEBUG update_data : {u'available': False} 20:00:25 workflow.py:2331 DEBUG Set last run version : 0.7.0 20:00:25 workflow.py:2176 DEBUG Workflow finished in 0.005 seconds. And this error message on Safari: Edited June 22, 2019 by xilopaint Link to comment
able Posted February 21, 2016 Share Posted February 21, 2016 This is great! is there a way of making this always open in Google Chrome (not my default browser). Reason being - I only use Google Drive with my work stuff, which is always in Google Chrome. Link to comment
azai91 Posted April 27, 2016 Author Share Posted April 27, 2016 Update. Added another feature which allows you to create google docs, sheets, forms, and slides with the extension. the extension now also supports opening pdfs! @able - sorry the late response - I frequently check github issues and only come on alfredforum periodically. I am working on a feature where users can customize their settings a bit more personally - setting default browser sounds like a great feature. Link to comment
magnotti Posted May 19, 2017 Share Posted May 19, 2017 Anyone notice the Python process hogs the CPU when using this workflow? What's up with that? Is there a fix? 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