azai91 / alfred-drive-workflow

Alfred workflow to search google drive
MIT License
224 stars 23 forks source link

Multi-account access #8

Open altern8tif opened 8 years ago

altern8tif commented 8 years ago

Just wondering if it's possible to allow for the workflow to access multiple google drive accounts?

azai91 commented 8 years ago

It is possible - I will be adding that in a future release.

altern8tif commented 8 years ago

:+1:

littke commented 8 years ago

@altern8tif A workaround might be to share the folders from one account to the other. In my case, my work Drive has shared access to my private Drive, and therefore I can search them both.

altern8tif commented 8 years ago

@littke not a big fan of that though. Prefer to keep work/personal separated. @azai91 is this feature still on the cards? Sorry I can't help much... Not really a python dev

azai91 commented 8 years ago

yes is on the cards still. it is my next major feature.

seanyhc commented 7 years ago

Just want to say I really love the workflow. And it would be even better to support multiple accounts, whether by having an argument, or even just be able to tie to one account and then duplicate the workflow to tie to another. Thanks.

josiekre commented 7 years ago

I would love to use the multiple account functionality too. What's your progress on this feature? Could I help in anyway?

sorbits commented 7 years ago

How would this work?

Should the workflow present all items from all accounts mixed together?

Should the New Document actions take an additional account parameter?

Have you considered that seeing items from all accounts via the workflow does not mean that all items can actually be opened? The workflow opens the link in your browser, and your browser will only be signed into one of your accounts.

dkpalmer commented 7 years ago

For me, the expectation of being properly authed in the browser is acceptable.

I don't know how nested you can go w/ Alfred. Would it be possible to do d > [select account] > action against that account (e.g. search)? I personally wouldn't want to see all my accounts mixed together.

sorbits commented 7 years ago

[…] Would it be possible to do d > [select account] > action against that account (e.g. search)?

Technically it should be possible, however, since one-account users would not want to have to go through an account selector each time, we would still need a non-[select account] mode.

This makes me think that instead, it should default to items from last account used but with a d Change Account action — we could still have items further down in the hierarchy, e.g.:

So to create a new spreadsheet on your (current) business account you would just do: d ns Budget 2018.

If you want to create a spreadsheet on your personal account, you need to do: d Change Account Personal ns Vacation Planning.

After this, the root level items will be those from your personal account, so you can access these directly, or switch back to your business account.

How does this sound?

There are two challenges here, one is that when signing in to Google Drive, we only get an access token, we do not get any sort of identifier, so the user will have to manually assign a name to each of their accounts. I think this could be done using an item like d Save Account Using [name], I guess then we also need a way to delete accounts…

The other challenge is that Alfred is not built for workflows with hierarchical output, so each time we drill down in the hierarchy, we must append something unique to the query string for our script to identify.

ryanjm commented 6 years ago

I'd think search should work across all the accounts and just include the account name as part of the path.

As for creating new documents, I think having a default account to work from good enough. You could leave off support for creating documents in other accounts.

If you eventually do want to support creating documents in other accounts, then I think your idea of naming the other account(s) is a good one. I'd just suggest not changing accounts since that would require the user to constantly be jumping back and forth between accounts.

Instead, in order to create a new document in the account [name] do something like d [name] ns [spreadsheet name]. This would allow you to always leave the default account alone.

With this workflow, they will end up selecting the account they use the most often as the default and then only have to use the additional [name] parameter occasionally. That'd be the least amount of friction/work for the user.

If it is too hard to pull in the search items from multiple accounts, you could add this same name field for search too. d [search] would search the default account. d [name] [search] would search the named account. The only downside here (which isn't a big deal) is that you couldn't search for your named account ([name]) within your default account.

FYI: I am signed into multiple Google accounts at the same time and I can open links to any of the accounts I'm currently signed in with. It will automatically use the right account.

I hope Alfred 4 will enable hierarchical/multiple steps, that'd make many workflows a lot nicer.

ajwaxman commented 5 years ago

I'm a huge fan of your workflow. Thanks so much for everything you've built so far 🙏

Any chance this issue is still on the radar?