Jasondm007 Posted January 26, 2018 Share Posted January 26, 2018 Is it possible to remove a keyword that winds up being used in a fallback search? Since I’m probably not asking this question in the appropriate Alfred lingo, let me provide an example. Let’s say you have a file filter that uses the keyword “oo” when searching for OmniOutliner files. After searching for “oo searchterm” in Alfred, it doesn’t find anything relevant, and so you decide to use one of your fallback searches. For simplicity, let’s say you select the default Google search fallback. When run, Google searches for the following: “oo searchterm”. My question is whether it could be run without the “oo “ (i.e., without the keyword and space). In other words, could Alfred snip out everything before the first blank space in the search (and preferably the first blank space, too)? To be clear, my question is not specific to Alfred’s default Google search fallback. I have other fallbacks that use Finder, Spotlight, etc that I’d like to solve the problem with. I just find it annoying to always have to go back and clip off that first bit, especially when the searches all follow the same pattern (unnecessarykeyword+blankspace). Thanks for your help! cabsuwepa 1 Link to comment
GuiB Posted January 26, 2018 Share Posted January 26, 2018 (edited) Since a fallback search can't determine what you have in mind when you give it a string to process, there's no way it could intelligently remove the first word of a string (well, from my understanding). Therefore, I think you best bet would be to redefine the fallback searches that you wish them to process how you define it. I did a workflow as an example to show you as a way to make a more "intelligent" fallback search based on your criteria. I did two version, but I think the first one would be the best one to use as a replacement to the default fallback search, but need a little more work from your side. In short, you make a list of keywords separated by semicolon and if you send a string to this fallback search and the workflow find that the first word is into this keywords list, then it will remove it or if not found it would keep the string as is. The second example always remove the first word, so maybe best to use next to the default fallback search. To change the keywords list or add to it for the first method, just look into the environment variable in the Workflow preferences. I put ";" as the delimiter, but let you change it if you prefer another one Link: https://nofile.io/f/RX05s5Z9c8o/Fallback+Search+-+Removed+Keyword.alfredworkflow Best Edited March 19, 2018 by GuiB Link to comment
Jasondm007 Posted January 28, 2018 Author Share Posted January 28, 2018 Thanks for the response, @GuiB. I'm not sure that I understand what you mean. Could you repost your workflow? Its link doesn't appear to be working. Thanks! Link to comment
GuiB Posted January 28, 2018 Share Posted January 28, 2018 (edited) @Jasondm007, sorry, I don't know what happened, but here is another try at uploading: https://nofile.io/f/RX05s5Z9c8o/Fallback+Search+-+Removed+Keyword.alfredworkflow -------- Edit: Make sure to add the Fallback Search to you Default Results Fallback Searches at : Alfred Preferences -> Default Results -> Setup fallback results -> + -> Workflow trigger -> Search Google for '{query}' (Removing keyword) or Search Google for '{query}' (Removing first word) Edited March 19, 2018 by GuiB Jasondm007 1 Link to comment
.ed Posted March 19, 2018 Share Posted March 19, 2018 Hello, my very first post here. id like to know how to achieve this, but the example link has broken. Can anyone help to elaborate or upload again? Thanks. Link to comment
GuiB Posted March 19, 2018 Share Posted March 19, 2018 @.ed , I have updated the link in my post above. Just try again and it should work now .ed and Jasondm007 2 Link to comment
.ed Posted March 20, 2018 Share Posted March 20, 2018 19 hours ago, GuiB said: @.ed , I have updated the link in my post above. Just try again and it should work now Thank you so much! It works great! Link to comment
Jasondm007 Posted July 23, 2018 Author Share Posted July 23, 2018 @GuiB I'm not sure how I missed your response above (perhaps, the holiday fog?), but I recently stumbled on this thread when looking for a fix to the same problem. In any event, I just wanted to apologize for the slow response and thank you for posting your workflow. It's brilliant, and works like a charm! Link to comment
cabsuwepa Posted September 13, 2019 Share Posted September 13, 2019 @GuiB Link is down again? Would like to use it, since it seems to work Link to comment
GuiB Posted September 13, 2019 Share Posted September 13, 2019 @cabsuwepa, here it is: https://d.pr/f/X5kfAF cabsuwepa 1 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