jsumners / alfred-emoji

Alfred workflow for searching and copying emoji
741 stars 32 forks source link

Insert by default and `:` keyword #63

Open fabswt opened 2 years ago

fabswt commented 2 years ago

Hi there,

I've been trying to do these things:

Thanks for the help!

jsumners commented 2 years ago

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 commented 2 years ago

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:

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 commented 2 years ago

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

fabswt commented 2 years ago

Yes.

jsumners commented 2 years ago

Then it is clear doing so will not work.

fabswt commented 2 years ago

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

jsumners commented 2 years ago

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 commented 2 years ago

Sure, no worries, just asking.

rmm5t commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

Maybe we should document it.

rmm5t commented 2 years ago

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 commented 2 years ago

Certainly no rush. 🦃🦃🦃

qubist commented 2 years ago

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.