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

Insert by default and : keyword #63

Open
fabswt opened this issue Nov 21, 2021 · 16 comments
Open

Insert by default and : keyword #63

fabswt opened this issue Nov 21, 2021 · 16 comments

Comments

@fabswt
Copy link

fabswt commented Nov 21, 2021

Hi there,

I've been trying to do these things:

  • Use colon (:) as the keyword, without a space (for consistency with, say, Notion, GitHub, and to speed things up) So as to look for, say, :clown.
    • It works... to a limit: results include (distracting) non-emoji results, e.g.: :a will return both "Activity monitor" and other programs, along a couple of emojis. Any option to not fall back to non-emoji results?
  • Make insert ("Paste {query} into frontmost application") the default behavior to speed things up.
    • I was successful making the change (just unticked the 'Command' modifier key in the workflow on the one brand, to tick it and set modifier subtext "Copy "{query}" to clipboard" on the other brand.) Problems are: the default text still remains "Copy ... to clipboard", and it copies it to clipboard anyway, which is not desirable.)
    • I tried editing the plist (and then restarting Alfred) to edit the phrasings, but it's been without impact. What did I miss?

Thanks for the help!

@jsumners
Copy link
Owner

jsumners commented Nov 22, 2021

The :<thing> syntax is used by those editors as a way for their parser to pick up that the user is trying to type an emoji character. Alfred works on keywords, as you noted, and those require a separator, e.g. this suggestion would become : clown. You are welcome to set your own keyword for the workflow via the workflow preferences; note that you'd likely have to adjust the keyword after every workflow update.

The current default behavior follows the standard Alfred behavior. Making the change to "insert on enter" would make this workflow counter intuitive to Alfred users.

@fabswt
Copy link
Author

fabswt commented Nov 22, 2021

I'm not sure I follow for the editor thing... When I type :<thing> in an editor, I'm right in the editor. When I type :<thing> inside of the Alfred bar, the editor does not know about it. My question was how come some of the results come from outside the real of emojis (there's visibly a form of fallback mechanism in the search, disabling it would get rid of the irrelevant results.) This depends on the search, see:

  • Works fine with query :smile:
    Screen Shot 2021-11-22 at 2 37 36 PM
  • Getting irrelevant results with query :a:
    Screen Shot 2021-11-22 at 2 37 26 PM

I understand most users may want to keep using copy as the default behavior. But how would I go about making "insert on enter" the default behavior? (if only for me, or as an option.)

@jsumners
Copy link
Owner

jsumners commented Nov 22, 2021

Did you change the keyword of the workflow and uncheck "with space"?

@fabswt
Copy link
Author

fabswt commented Nov 23, 2021

Yes.

@jsumners
Copy link
Owner

Then it is clear doing so will not work.

@fabswt
Copy link
Author

fabswt commented Nov 23, 2021

Do you know why it's working with :smile but providing non-Emoji results with :a?

@jsumners
Copy link
Owner

No, I don't. You'd have to investigate how Alfred interprets keywords without a space in combination with the workflow's script. I do not have time to do this.

@fabswt
Copy link
Author

fabswt commented Nov 23, 2021

Sure, no worries, just asking.

@rmm5t
Copy link
Collaborator

rmm5t commented Nov 23, 2021

@fabswt Personally, I use a keyword snippet in Alfred to trigger this workflow. All my snippets start with a period (.), so my trigger is .:

But how would I go about making "insert on enter" the default behavior? (if only for me, or as an option.)

That's a feature you can enable. Just set the snippetapp environment variable (to any value) in the workflow configuration to change the behavior to always paste the emoji character regardless of how the workflow is instantiated.

More information can be found on the forum thread about this starting here:
https://www.alfredforum.com/topic/11126-alfred-emoji-search-emojis-by-name-or-keyword/?do=findComment&comment=58339

Here's a screenshot of it too:
image

@rmm5t
Copy link
Collaborator

rmm5t commented Nov 23, 2021

Do you know why it's working with :smile but providing non-Emoji results with :a?

@fabswt Agreed with @jsumners here. I think this is a side effect of Alfred, not necessarily this emoji workflow. That might be a good question for the general Alfred forum.

@fabswt Do you think this issue needs to remain open, or are you okay with closing this out now?

@jsumners
Copy link
Owner

That's a feature you can enable. Just set the snippetapp environment variable (to any value) in the workflow configuration to change the behavior to always paste the emoji character regardless of how the workflow is instantiated.

@rmm5t I can't recall, and I'm on my phone right now, did we add this to the docs?

@rmm5t
Copy link
Collaborator

rmm5t commented Nov 23, 2021

@jsumners It doesn't look like it's in our README. Only documented on that forum thread.

Btw, it's a "feature" that's really a side-effect of another feature of how the snippet trigger works (because the snippet trigger pastes by default).

@jsumners
Copy link
Owner

Maybe we should document it.

@rmm5t
Copy link
Collaborator

rmm5t commented Nov 23, 2021

Maybe we should document it.

I’m out running Thanksgiving errands, but I can tackle that later if no one else submits a PR in the meantime. 😉

@jsumners
Copy link
Owner

Certainly no rush. 🦃🦃🦃

@qubist
Copy link

qubist commented Feb 26, 2022

I think macOS also uses : and / specially in file paths, which could be related to why searching :a is bringing up things with paths starting with :A.

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

No branches or pull requests

4 participants