Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike on how multi-word tags are going to work #3

Open
chrisbro opened this issue Jun 28, 2017 · 2 comments
Open

Spike on how multi-word tags are going to work #3

chrisbro opened this issue Jun 28, 2017 · 2 comments
Assignees
Projects

Comments

@chrisbro
Copy link
Owner

My regex-fu is not quite strong enough to make this easy. Need to figure out how best to support multi-word tags without screwing everything up.

@chrisbro chrisbro self-assigned this Jun 28, 2017
@chrisbro chrisbro added this to To Do in alfred-bear Jun 28, 2017
@robwalton
Copy link

robwalton commented Apr 1, 2018

It looks like this is almost working (in your latest GitHub release). Its just that the url to bear needs UTF8 encoding (to replace spaces with %20). Happy to attach pull request, but it seems to work with two quick changes:

  1. Replaced the bash code following the bst script filter with:
query="{query}"

if [[ $query == ":t:"* ]]; then
	printf "bear://x-callback-url/open-tag?name=%s" "${query:3}"
else
	printf "bear://x-callback-url/open-note?id=%s" "${query:3}"
fi
  1. Fed the output of this into a new 'Open URL' block.

robwalton added a commit to robwalton/alfred-bear that referenced this issue Apr 2, 2018
Add UTF8 encoding (to replace spaces with %20) to `utl` command.

1. Replace the bash code following the `bst` script filter with:
```bash
query="{query}"

if [[ $query == ":t:"* ]]; then
	printf "bear://x-callback-url/open-tag?name=%s" "${query:3}"
else
	printf "bear://x-callback-url/open-note?id=%s" "${query:3}"
fi
```
2. Fedd the output of this into a new 'Open URL' block.
@chrisbro
Copy link
Owner Author

chrisbro commented Jun 9, 2018

@robwalton Thanks a ton for the tip!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants