nikivi Posted March 2, 2017 Share Posted March 2, 2017 I want to capture a query in this file filter of this workflow (https://transfer.sh/9V1Ep/a-search-for-content.alfredworkflow). Right now it passes a path to the file but I want to save the actual query. For example I highlight some text, press the trigger and it would do this : Then if I press on let's say 'cocoa', I want to put this 'highlight' or any other query I made into my clipboard. I am sure you can do it, just not sure how. Thank you for any help. Link to comment
nikivi Posted March 2, 2017 Author Share Posted March 2, 2017 (edited) I just realised that I can solve it by connecting the trigger to the clipboard so this works. Edited March 2, 2017 by nikivi Link to comment
nikivi Posted March 2, 2017 Author Share Posted March 2, 2017 As a note, perhaps someone does use Keyboard Maestro here. I really like how I can combine KM and Alfred. I have an alfred utility folder in KM : I can then create quick helpers in KM like this : And then call it from Alfred : It's a lot faster to glue keystrokes, scripts and everything in KM thanks to its spotlight picker of actions. The only downside, is that if I want to share this workflow, I actually have to translate all the actions to applescript since I can't assume users owning KM but for quick personal workflows, it has been really productive for me. Link to comment
nikivi Posted March 2, 2017 Author Share Posted March 2, 2017 Now that I think of it, you can actually create a pretty handy library of actions this way in KM, and then all you need is to call an applescript of it. Link to comment
nikivi Posted March 2, 2017 Author Share Posted March 2, 2017 (edited) Actually sadly that only solves the 'selection in macOS' trigger. If I do actually do want to make a search from an external trigger, it doesn't save the query. How can I save a query from there if I can? Here is the workflow at its current state : https://transfer.sh/c2BJI/search-for-content.alfredworkflow Thank you for any help. Edited March 2, 2017 by nikivi Link to comment
Vero Posted March 2, 2017 Share Posted March 2, 2017 @nikivi I haven't had a chance to look at your workflow, but you may find the Arg/Vars utility useful, as it can be used to save a query as a variable if needed. Save it as a variable, then use {var:name} to use it later on in your workflow https://www.alfredapp.com/help/workflows/advanced/variables/ Let us know how you get on! Cheers, Vero Link to comment
nikivi Posted March 2, 2017 Author Share Posted March 2, 2017 (edited) Hey @Vero, The issue is not the saving of the query I get but actually getting what I type into the file filter out. Since what I write in the file filter gets passed onto to somewhere I don't know, all I get is the path of the file in the end. Edited March 2, 2017 by nikivi Link to comment
nikivi Posted March 4, 2017 Author Share Posted March 4, 2017 (edited) The only way I see to solve this is this : Where I first activate keyword, capture my query, put it to clipboard and then with that query I go to file filter. Although this is really hacky and bad since I have to press return twice. Also if I do decide to change my query whilst in the file filter, the clipboard will have the old value. I wish there was an easier way to do this and get the query straight from the file filter if possible. Edited March 4, 2017 by nikivi Link to comment
nikivi Posted March 6, 2017 Author Share Posted March 6, 2017 So I suppose there is no way to capture this query from the file filter? Link to comment
nikivi Posted March 8, 2017 Author Share Posted March 8, 2017 (edited) Perhaps I should move this topic into 'feature requests' section. I rely on this action a lot in my workflow but I really don't have any idea as to how I can find a solution to this. Another option is to look into building a file filter of my own but my request seems like such a trivial thing to add and Alfred's file filter is staggeringly fast. I doubt my implementation would be as fast. Edited March 8, 2017 by nikivi Codeplus 1 Link to comment
Codeplus Posted January 30, 2018 Share Posted January 30, 2018 Yes, been wanting this feature for years. Here's my scenario: Use File Filter to search in a folder and within PDF documents for a work order number. For example: wo 12345 A list of PDF's that contain that number are shown. Open PDF file in Preview. So far, everything works as expected. Then I would like to take the work order number, in this case 12345, and enter it into Preview's search field. But, I don't have access to the original query. It would be nice if Alfred would save the original query as an internal variable when using File Filter, similar to {query}. It doesn't seem like it would be a breaking change if implemented. I have tried using a Keyword first, to grab the original query, but then I have to hit enter to see the results. This breaks backspacing to refine the search. nikivi 1 Link to comment
deanishe Posted January 30, 2018 Share Posted January 30, 2018 2 hours ago, Codeplus said: I have tried using a Keyword first, to grab the original query, but then I have to hit enter to see the results. This breaks backspacing to refine the search. On 08/03/2017 at 4:49 PM, nikivi said: building a file filter of my own I think these are currently your only two options. Sounds like a useful—and relatively simple—feature. You should submit a feature request. Link to comment
Codeplus Posted January 30, 2018 Share Posted January 30, 2018 10 minutes ago, deanishe said: I think these are currently your only two options. Sounds like a useful—and relatively simple—feature. You should submit a feature request. The following is in the Feature Request section of the forum from 2013: Link to comment
deanishe Posted January 30, 2018 Share Posted January 30, 2018 Not quite. They're talking about Script Filters, and it's very easy to capture the query in a Script Filter by creating a variable for the original query (or back when that thread was posted, saving it to a file). File Filters and List Filters are a very different matter because there isn't a reasonable workaround. So, I don't think a feature request would be at all inappropriate. 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