Guest Posted November 29, 2020 Share Posted November 29, 2020 Currently I have setup "g" as a keyword for Google search with suggestions. I was wondering if there's a way to make this the default for Alfred like it is for Spotlight. Link to comment
Chris Messina Posted November 29, 2020 Share Posted November 29, 2020 Check out @deanishe's Searchio Workflow. Link to comment
Guest Posted November 29, 2020 Share Posted November 29, 2020 Thank you, but doesn’t this also require setting up a keyword such as “g” or “gs”? I would like the suggestions to pop up without having to enter a keyword. Link to comment
deanishe Posted November 30, 2020 Share Posted November 30, 2020 5 hours ago, lukerooneyio said: would like the suggestions to pop up without having to enter a keyword. Alfred doesn’t work that way, I’m afraid. You can add a hotkey that takes you straight to a workflow, but you can’t include a workflow’s results in Alfred’s default results. Link to comment
Mr Pennyworth Posted November 30, 2020 Share Posted November 30, 2020 (edited) On 11/30/2020 at 9:23 AM, deanishe said: Alfred doesn’t work that way, I’m afraid. You can add a hotkey that takes you straight to a workflow, but you can’t include a workflow’s results in Alfred’s default results. @deanishe is right in pointing this out. Rather, I would even go ahead and make a guess that Alfred's not designed to be used this way. However, in the spirit of tinkering, if we're okay with ugly, unwieldy hacks to just see what's possible, what you're asking @lukerooneyio, can be done. Edit: learnt this cool trick from: https://github.com/biati-digital/alfred-calculate-anything Be warned: It is ugly It is possible that it has performance issues It leads to inconsistency That out of the way, here's how one could go about achieving the end result of "google search suggestions in Alfred without explicitly typing a keyword". Oh wait, let me clarify: we will be using keywords all right, just that, from the user's point of view, it appears as if there are no keywords involved. Here, I searched for "screen", and you can see three google auto-suggestions: "screen recorder", "screener", "screenshot" Apart from messy implementation, the two biggest issues I see with this hack are: Predictability: Alfred's default fallback searches always appear at the very bottom. This one, on the other hand, could appear anywhere (right at the top, somewhere in the middle like this screenshot, or not at all if Alfred thinks that there are other much better matching results) Consistency: In Alfred's default search, I expect results to show instantly, and I don't expect them to change once they display on screen. Here, the google suggestions take time to show up and finalize. See the GIF: Before it finalizes on "sketches, sketchup ...", the results briefly read "speed test, sports ..." I believe now we're truly done with disclaimers and "why this might not be a good idea", here's the implementation, where I added 26 extra script filters to @deanishe excellent searchio workflow: (one script filter for each small-case letter) This is how the default google search script filter in searchio ran: # keyword google # with space # argument required ./search google-en "$1" This is how each of the script filters I added runs: # keyword s # without space # argument required # choose only top 3 results # note the "s$1" res=$(./search google-en "s$1" | /usr/local/bin/jq '.items[:3]') echo "{\"items\": $res}" Edited December 2, 2020 by Mr Pennyworth Added where I learnt this trick from deanishe 1 Link to comment
deanishe Posted November 30, 2020 Share Posted November 30, 2020 (edited) Took me a minute to figure out what you'd done there. That's another very clever solution. 48 minutes ago, Mr Pennyworth said: I would even go ahead and make a guess that Alfred's not designed to be used this way. OTOH, it also kinda is. It'd be a terrible idea to convert all your workflows to run like this. But one workflow adding max. 3 results is just pure clever, imo. 48 minutes ago, Mr Pennyworth said: Here, the google suggestions take time to show up and finalize. No luck fiddling with the "Run Behaviour" settings? Edited November 30, 2020 by deanishe Mr Pennyworth 1 Link to comment
Mr Pennyworth Posted November 30, 2020 Share Posted November 30, 2020 58 minutes ago, deanishe said: No luck fiddling with the "Run Behaviour" settings? oh wow!! Just switched from "wait until previous script finishes" to "terminate previous scripts" So much snappier and much less flickering! No idea why I had set that setting in the first place 🤦🏻♂️ Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now