Jump to content

Gmail Client for Alfred


Recommended Posts

Hi, I have two questions about multiple accounts.

 

I copied the workflow and only changed the keyword, then I run python gmail.py. However, it didn't ask me for the verification code this time. I can only use the second copy log into my first gmail account. Could you tell me how to solve it?

 

Another question is my own problem but I don't how to do. Gmail web page isn't launched in my default browser(Chrome),  but in a new tab of my iterm. Actually, all url links(e.g. webpage URLs in pdf) are now open in my terminal rather than my browser.

 

Thanks a lot

Link to comment

Hi, I have two questions about multiple accounts.

 

I copied the workflow and only changed the keyword, then I run python gmail.py. However, it didn't ask me for the verification code this time. I can only use the second copy log into my first gmail account. Could you tell me how to solve it?

 

Another question is my own problem but I don't how to do. Gmail web page isn't launched in my default browser(Chrome),  but in a new tab of my iterm. Actually, all url links(e.g. webpage URLs in pdf) are now open in my terminal rather than my browser.

 

Thanks a lot

 

When you duplicate the workflow, make sure you change the Bundle ID to something other than com.fniephaus.gmail. That should solve your first problem.

 

Re your 2nd question: looks like your LaunchServices are misconfigured. Maybe google the problem or you might want to try a tool like this: http://www.rubicode.com/Software/RCDefaultApp/ (haven't used it myself)

 

Hope this helps!

Link to comment
  • 4 weeks later...

What have you typed into Alfred? Line numbers?

 

I'm not the one who posted this, but I got the same issue. 

 

I guess it only happens when the cache is empty and the Inbox is empty, too.

 

Added 

    if(threads['resultSizeEstimate']==0):
	   return [];
before line 61 in gmail_refresh.py.
fixed it for me.

 

 

Greetings Badagent

Edited by badagent
Link to comment
  • 1 month later...

Hi I am looking forward to use this workflow looks great!!

 

But I got this message when I tried to use the workflow:

 

[ERROR: alfred.workflow.input.scriptfilter] Code 1: 01:04:16 workflow.py:1429 DEBUG    Loading cached data from : /Users/wandersonferreira/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/gmail_list.cpickle

01:04:16 workflow.py:1764 ERROR    'NoneType' object has no attribute '__getitem__'

Traceback (most recent call last):

  File "/Users/wandersonferreira/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.652750E0-221B-47E0-8BD1-00C0CFA153C4/workflow/workflow.py", line 1762, in run

    func(self)

  File "gmail.py", line 31, in main

    subtitle = '%s - %s' % (item['Date'][:-6], item['snippet'])

TypeError: 'NoneType' object has no attribute '__getitem__'

 

 

Thanks for help!

Best

Link to comment
  • 4 weeks later...

Is there any plan to make this workflow async? 

Now it takes time after actions like archivation for alfred to appear again. 

It would be magic if all requests were made in background. 

 

That's definitely something that could be improved.

I haven't really thought about it yet...and some things like notifications require the user to press enter.

 

I've opened an issue on GitHub: https://github.com/fniephaus/alfred-gmail/issues/12

 

Feel free to comment on that or even open more issue with more ideas!

Link to comment
  • 2 months later...

Hello, 

For some weird reason, I cannot get emails from my inbox, but I get starred or unread emails. Any ideas?

 

 

[sTDERR: alfred.workflow.input.scriptfilter] 10:17:12 workflow.py:2053 DEBUG    Update check not due

10:17:12 workflow.py:1544 DEBUG    Loading cached data from : /Users/sdaza/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/__workflow_update_status.cpickle

10:17:12 background.py:180 DEBUG    Command arguments cached to `/Users/sdaza/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/gmail_refresh.argcache`

10:17:12 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/sdaza/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCF8141A-7734-4398-AA6C-A541DF2E19BE/workflow/background.pyc', 'gmail_refresh'] ...

10:17:12 workflow.py:1907 DEBUG    Workflow finished in 0.002 seconds.

10:17:12 workflow.py:1907 DEBUG    Workflow finished in 0.003 seconds.

10:17:12 background.py:189 DEBUG    Executing task `gmail_refresh` in background...

[sTDERR: alfred.workflow.input.scriptfilter] 10:17:14 workflow.py:2053 DEBUG    Update check not due

10:17:14 workflow.py:1544 DEBUG    Loading cached data from : /Users/sdaza/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/__workflow_update_status.cpickle

[sTDERR: alfred.workflow.input.scriptfilter] 10:17:14 workflow.py:2053 DEBUG    Update check not due

10:17:14 workflow.py:1544 DEBUG    Loading cached data from : /Users/sdaza/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/__workflow_update_status.cpickle

[ERROR: alfred.workflow.input.scriptfilter] Code 1: 10:17:15 workflow.py:2053 DEBUG    Update check not due

10:17:15 workflow.py:1544 DEBUG    Loading cached data from : /Users/sdaza/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/__workflow_update_status.cpickle

10:17:15 workflow.py:2154 DEBUG    Got password : com.fniephaus.gmail:gmail_credentials

Traceback (most recent call last):

  File "gmail.py", line 254, in <module>

    main()

  File "gmail.py", line 126, in main

    refresh_cache([label])

  File "/Users/sdaza/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCF8141A-7734-4398-AA6C-A541DF2E19BE/gmail_refresh.py", line 128, in refresh_cache

    label.lower(), get_list(http, gmail_service, label))

  File "/Users/sdaza/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCF8141A-7734-4398-AA6C-A541DF2E19BE/gmail_refresh.py", line 95, in get_list

    batch.execute(http=http)

  File "/Users/sdaza/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCF8141A-7734-4398-AA6C-A541DF2E19BE/oauth2client/util.py", line 132, in positional_wrapper

    return wrapped(*args, **kwargs)

  File "/Users/sdaza/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCF8141A-7734-4398-AA6C-A541DF2E19BE/apiclient/http.py", line 1330, in execute

    callback(request_id, response, exception)

  File "/Users/sdaza/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCF8141A-7734-4398-AA6C-A541DF2E19BE/gmail_refresh.py", line 89, in wrapper

    list_threads(label, request_id, response, exception)

  File "/Users/sdaza/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCF8141A-7734-4398-AA6C-A541DF2E19BE/gmail_refresh.py", line 59, in list_threads

    'value'])

  File "/Users/sdaza/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.CCF8141A-7734-4398-AA6C-A541DF2E19BE/gmail_refresh.py", line 72, in get_date

    return strftime("%m/%d/%Y %H:%M", parsedate(date_str))

TypeError: argument must be 9-item sequence, not None

Link to comment

Hello, 

For some weird reason, I cannot get emails from my inbox, but I get starred or unread emails. Any ideas?

 

Hi Sebastian,

Thanks for the bug report.

Could you please delete the `com.fniephaus.gmail` entry from your keychain and then try again?

Link to comment
  • 2 weeks later...

This workflow seems amazing. But I can't get it going. No matter which mailbox I choose (INBOX, STARRED, SENT, SPAM, ETC) I get "No Mails Found". Can you help?

 

Starting debug for 'Gmail Client for Alfred'

 

[sTDERR: alfred.workflow.input.scriptfilter] 16:28:08 workflow.py:2053 DEBUG    Update check not due

16:28:08 workflow.py:1544 DEBUG    Loading cached data from : /Users/Wass/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/__workflow_update_status.cpickle

16:28:08 background.py:180 DEBUG    Command arguments cached to `/Users/Wass/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/gmail_refresh.argcache`

16:28:08 background.py:184 DEBUG    Calling [u'/usr/bin/python', '/Users/Wass/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.0CC619D6-D3A8-4F00-B4BF-A674D6704977/workflow/background.pyc', 'gmail_refresh'] ...

16:28:08 workflow.py:1907 DEBUG    Workflow finished in 0.001 seconds.

16:28:08 workflow.py:1907 DEBUG    Workflow finished in 0.002 seconds.

16:28:08 background.py:189 DEBUG    Executing task `gmail_refresh` in background...

[sTDERR: alfred.workflow.input.scriptfilter] 16:28:18 workflow.py:2053 DEBUG    Update check not due

16:28:18 workflow.py:1544 DEBUG    Loading cached data from : /Users/Wass/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/__workflow_update_status.cpickle

16:28:18 workflow.py:1544 DEBUG    Loading cached data from : /Users/Wass/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/gmail_inbox.cpickle

[ERROR: alfred.workflow.action.script] 16:28:21 workflow.py:1907 DEBUG    Workflow finished in 0.103 seconds.

[sTDERR: alfred.workflow.input.scriptfilter] 16:28:21 workflow.py:2053 DEBUG    Update check not due

16:28:21 workflow.py:1544 DEBUG    Loading cached data from : /Users/Wass/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/__workflow_update_status.cpickle

[sTDERR: alfred.workflow.input.scriptfilter] 16:28:23 workflow.py:2053 DEBUG    Update check not due

16:28:23 workflow.py:1544 DEBUG    Loading cached data from : /Users/Wass/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/__workflow_update_status.cpickle

16:28:23 workflow.py:1544 DEBUG    Loading cached data from : /Users/Wass/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.fniephaus.gmail/gmail_starred.cpickle

Link to comment

This workflow seems amazing. But I can't get it going. No matter which mailbox I choose (INBOX, STARRED, SENT, SPAM, ETC) I get "No Mails Found". Can you help?

 

Hi Eric,

Thanks for getting in touch.

Could you also please delete the `com.fniephaus.gmail` entry from your keychain and then try again?

Unfortunately, I can't really tell from your log what's causing your issue.

What workflow, Alfred version and operating system are you using?

 

Fabio

Link to comment

Hi Eric,

Thanks for getting in touch.

Could you also please delete the `com.fniephaus.gmail` entry from your keychain and then try again?

Unfortunately, I can't really tell from your log what's causing your issue.

What workflow, Alfred version and operating system are you using?

 

Fabio

I tried deleting the keychain entry and that did force me to re-log into gmail. Unfortunately, though, it didn't solve the problem and the same keychain entry is back.

Alfred v 2.6 (374)

OS X 10.10.2

Gmail for Alfred 1.1

 

Thank you!

Link to comment

I tried deleting the keychain entry and that did force me to re-log into gmail. Unfortunately, though, it didn't solve the problem and the same keychain entry is back.

Alfred v 2.6 (374)

OS X 10.10.2

Gmail for Alfred 1.1

 

Thank you!

 

Thanks, Eric. I think I was able to track down the problem!

Here's a new version that should fix it:

https://github.com/fniephaus/alfred-gmail/releases/tag/v1.2

 

Same problem here... it creates the same keychain `com.fniephaus.gmail` , over and over. 

Thanks!

 

The workflow saves the access token in your keychain, so the file is supposed to be created if it does not exist. Deleting the file will force you to re-authenticate. In v1.2 I've now added a shortcut (`wf:deauth`) for doing this.

Edited by fniephaus
Link to comment

After some initial CACHE errors it now seems to be working beautifully. Thanks for making this. Excellent job!

 

Thanks, Eric. I think I was able to track down the problem!

Here's a new version that should fix it:

https://github.com/fniephaus/alfred-gmail/releases/tag/v1.2

 

 

The workflow saves the access token in your keychain, so the file is supposed to be created if it does not exist. Deleting the file will force you to re-authenticate. In v1.2 I've now added a shortcut (`wf:deauth`) for doing this.

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