Jump to content
wwwjfy

Is there a way to show Alfred search bar by alfred:// scheme?

Recommended Posts

I noticed that b74 added alfred:// scheme, and can be used to share themes.

I'd like to know is there the usage to activate Alfred search bar with {query}? That will help a lot. Good way to develop workflows

Share this post


Link to post
Thats not what the alfred:// url scheme is for. However, you could easily create this functionality using Applescript.

Good to know it's doable, in some way. Could you give an example? thanks~

Share this post


Link to post

Doing this with Applescript:

 

on alfred_script(q)
	tell application "System Events" to keystroke space using command down
	tell application "System Events" to keystroke "david"
end alfred_script

 

That would open Alfred and type my name into him. If you had passed a parameter into that action (available as q) you could make Alfred type that.

Share this post


Link to post
Doing this with Applescript:

 

on alfred_script(q)
	tell application "System Events" to keystroke space using command down
	tell application "System Events" to keystroke "david"
end alfred_script

 

That would open Alfred and type my name into him. If you had passed a parameter into that action (available as q) you could make Alfred type that.

 

Thanks at first. This one works, "kind of".

 

The problems are:

- start with a little one, that the "keystroke" makes some latency, because the system needs to type in. So it seems imperfect, but it's not a big problem.

- As I assign it to command+shift+d, I have to press the hotkey and lift my fingers very fast, otherwise, it'll be command+shift+option+d+space (I use option+space to trigger Alfred 2). This is kind of a big problem for me, and I believe it's not comfortable for many to gamble the speed of apple script triggered and how fast leaving the keyboard.

 

So, as it's still in beta, I would request either way (so I can have Alfred v1 not running for only one hotkey), have "Show Alfred" action back (it's already in v1), or have "alfred://" do the similar thing, or enable apple script support (not keystroke..), or any other workable way, instead of the workaround.

 

I understand you all work hard on this, and have balanced the old features, the new features and bug fixes. I appreciate that. Please at least reconsider it a bit, even in low priority that I cannot see it in near future

Share this post


Link to post

Tony,

 

This can be avoided by using the delay command in Applescript. So between the two "tell System Events" commands, add a: delay .5 and that will add a half second delay before the next command is fired. That should be enough to get past the key press issue. I made a similar solution for someone else and this seemed to work perfectly for them (with the delay)

Share this post


Link to post
Tony,

 

This can be avoided by using the delay command in Applescript. So between the two "tell System Events" commands, add a: delay .5 and that will add a half second delay before the next command is fired. That should be enough to get past the key press issue. I made a similar solution for someone else and this seemed to work perfectly for them (with the delay)

 

Thanks, that does improve the situation, making the workaround better, I can live with it now, though it still doesn't seem perfect to me.

As a user, and also a developer, I'd like it to be perfect. If the builtin way won't be implemented, the keystroke will disappoint me a bit.

 

Thanks again, now I can close Alfred v1. :)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...