nikivi Posted November 15, 2018 Share Posted November 15, 2018 (edited) I want to modify Searchio workflow so that if I press cmd key + return on any of the results, it would search what I typed into Alfred on Google/YouTube/.. So if I press cmd + return on alfred sickert result, it would instead of searching alfred sickert make a query on what I typed in Alfred (alfred is sick in this case). Thus saving me a keystroke of up arrow and return (where current fallback query is placed in Searchio). From what I understand, this is impossible to achieve due to Alfred not providing this information. Or I am wrong? If I am wrong. I would like to move this thread to feature requests as I really wish this feature existed. Thank you. Edited November 15, 2018 by nikivi Link to comment
nikivi Posted November 15, 2018 Author Share Posted November 15, 2018 To expand on this. I believe you can get the query with {query} inside the actual script filter. But I want to get this {query} variable inside Go code in some way. Link to comment
deanishe Posted November 15, 2018 Share Posted November 15, 2018 (edited) This doesn't make any sense. {query} is exactly what is fed to the program as input. Literally no Script Filter can work without it unless you have "Alfred filters results" checked. As you're talking about Searchio!, the variable is literally called query. All you need to do is modify the Item. Exactly how long did you spend thinking over this problem before you started making screenshots and composing your forum post? Five seconds? Less? Edited November 15, 2018 by deanishe nikivi 1 Link to comment
nikivi Posted November 15, 2018 Author Share Posted November 15, 2018 (edited) Going to try it. I thought about it for few minutes and tried building the workflow but had some problems developing it. p.s. I also like asking questions I guess. Bad habit. Edited November 15, 2018 by nikivi Link to comment
nikivi Posted November 17, 2018 Author Share Posted November 17, 2018 (edited) Programming isn't for me. Apologize for asking for help @deanishe Edited November 17, 2018 by nikivi Link to comment
deanishe Posted November 17, 2018 Share Posted November 17, 2018 Niki, you asked a question about something you’ve done a dozen times yourself. Any Script Filter you’ve written that doesn’t use “Alfred filters results” is using {query} (or ARGV). nikivi 1 Link to comment
dfay Posted November 18, 2018 Share Posted November 18, 2018 I just want him to answer this question. https://talk.automators.fm/t/sharing-all-the-shortcuts-i-use-activated-from-widgets/3052/2 Link to comment
nikivi Posted November 18, 2018 Author Share Posted November 18, 2018 @dfay I answered it on the thread. Link to comment
nikivi Posted November 18, 2018 Author Share Posted November 18, 2018 (edited) @deanishe Can you help with guiding me on how I can customize Searchio to do customized searches on modifier key presses? i.e. doing Google Lucky search on Google script filter with alt+return? I haven't touched Go in quite a bit of time and would literally do anything to get this feature working in Searchio. Edited November 18, 2018 by nikivi Link to comment
deanishe Posted November 18, 2018 Share Posted November 18, 2018 (edited) No, not really. What you're asking would be a lot of work because the basic data model of the workflow is "one engine per search". Changing that would require some fairly fundamental changes to the workflow, not just a few lines of Go. I'm not going to implement it because I have no use for the feature (I never, ever use "I'm feeling lucky" and I don't think it applies to any other search engines). And I'm not going to help you do it because helping you with code, I am sorry to say, is almost never an enjoyable or rewarding experience for me. Edited November 18, 2018 by deanishe nikivi 1 Link to comment
nikivi Posted November 18, 2018 Author Share Posted November 18, 2018 (edited) I will try to rewrite Searchio myself with a different data model. I also wanted to include a small portion of Searchio code in my Web Searches workflow to use Google powered suggestions queries to search any website on the net. (MIT license allows me to do it if I mention where I got the code from). But rewriting Searchio should be a learning experience. Might do it in OCaml too as I've been learning it. 33 minutes ago, deanishe said: I am sorry to say, is almost never an enjoyable or rewarding experience for me. Makes perfect sense. Thank you for your help and time. Edited November 18, 2018 by nikivi Link to comment
nikivi Posted November 18, 2018 Author Share Posted November 18, 2018 (edited) 26 minutes ago, deanishe said: I don't think it applies to any other search engines It does. i.e. cmd + return on YouTube search filter to make a search for past month on YouTube. I see many more cases where I want to scope my search to a certain filter but reuse the suggestions powered by Searchio. Although Google Lucky search is most crucial of them all. Edited November 18, 2018 by nikivi Link to comment
deanishe Posted November 18, 2018 Share Posted November 18, 2018 3 hours ago, nikivi said: I will try to rewrite Searchio myself with a different data model. That might be the best idea. Decouple the suggestions from the searches, and then you can mix and match as you please. Currently, that simply is not a goal for Searchio. nikivi 1 Link to comment
nikivi Posted November 18, 2018 Author Share Posted November 18, 2018 1 minute ago, deanishe said: Decouple the suggestions from the searches I do think that is a superior way than what Searchio provides currently. This way it is a lot more flexible and can achieve everything current Searchio achieves too. Link to comment
deanishe Posted November 18, 2018 Share Posted November 18, 2018 4 minutes ago, nikivi said: This way it is a lot more flexible and can achieve everything current Searchio achieves too. At the cost of increased complexity and the fact that you would then have suggestions that may not actually lead to any search results. So no, it doesn't achieve everything Searchio does. You lose the guarantee that there are some search results for the workflow's suggestions. Link to comment
nikivi Posted November 18, 2018 Author Share Posted November 18, 2018 1 minute ago, deanishe said: the fact that you would then have suggestions that may not actually lead to any search results By default you add a search engine that will as default result on activating suggestions run the query on the engine's website. Just like what Searchio does now. What makes Searchio unique is the suggestions. The version I am thinking of building looks and works exactly like Searchio does now but has ability to customize outputs of searches to custom URLs. Not sure how that would work Alfred wise but I believe it should be possible. Link to comment
nikivi Posted November 18, 2018 Author Share Posted November 18, 2018 (edited) In fact I think what would be awesome is to use my Web Searches workflow to let users customize custom searches driven by some engine. Either on default result or on modifiers. Through the settings, like what Search has with Installed Searches ... to list all current filters. On return of any of the results let user pick through return, alt, opt, cmd, fn, shift and then on return of those show up Web Searches prompt of all the different searches to map to. With ability to add a custom search if none of the searches you want satisfy you. (Of course user can also extend Web Searches database optionally too). That would be pretty cool I think and it's already written in Go. I might try to read through all of Searchio code and extract all the relevant parts I need to try make this work. If I will need to rewrite Searchio for this, so be it. Edited November 18, 2018 by nikivi Link to comment
deanishe Posted November 18, 2018 Share Posted November 18, 2018 51 minutes ago, nikivi said: I might try to read through all of Searchio code and extract all the relevant parts Searchio is 90% written in Python, not Go. Link to comment
nikivi Posted November 18, 2018 Author Share Posted November 18, 2018 Just now, deanishe said: Searchio is 90% written in Python That's fine too. Python is easy to read. And you have awesome comments. 🙂 Link to comment
nikivi Posted November 20, 2018 Author Share Posted November 20, 2018 Or using Google Engine suggestions to pass the query to Google's autocomplete visualizer. Holy shit this is exciting. 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