Jump to content

Recommended Posts

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.

 

search.gif

 

create.gif?raw=true

 

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.

login.gif

 

Please leave issues if you encounter any problems or star this repo if you found it useful :)

Edited by azai91
Link to comment

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

Link to comment
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

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 by deanishe
Link to comment

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

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.

Link to comment
  • 2 weeks later...

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
  • 2 weeks later...

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 by realbase
Link to comment
  • 1 month later...
  • 2 weeks later...
  • 2 weeks later...
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 by deanishe
Replace real name
Link to comment
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 by xilopaint
Link to comment
  • 4 weeks later...
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:

 

Image%202015-12-02%20at%2020.08.45.png

Edited by xilopaint
Link to comment
  • 2 months later...
  • 2 months later...

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
  • 1 year later...

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