wwwjfy Posted January 19, 2013 Share Posted January 19, 2013 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 Link to comment
jdfwarrior Posted January 19, 2013 Share Posted January 19, 2013 Thats not what the alfred:// url scheme is for. However, you could easily create this functionality using Applescript. Link to comment
wwwjfy Posted January 19, 2013 Author Share Posted January 19, 2013 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~ Link to comment
jdfwarrior Posted January 19, 2013 Share Posted January 19, 2013 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. Link to comment
wwwjfy Posted January 19, 2013 Author Share Posted January 19, 2013 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 Link to comment
jdfwarrior Posted January 19, 2013 Share Posted January 19, 2013 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) Link to comment
wwwjfy Posted January 20, 2013 Author Share Posted January 20, 2013 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. Link to comment
Recommended Posts