Mr Pennyworth Posted December 1, 2020 Posted December 1, 2020 Alfred History Search An Alfred workflow to search through query history, and execute queries from history. Note: This post might be out-of-date. Here's the up-to-date README. Usage Download the latest release Searching Through Query HistoryAssign hotkey trigger (⌃R recommended)While using Alfred, press the hotkey. Alfred's query history will show up:Start typing to search through the query history.Actioning any of the history entries makes Alfred search that query. Deleting Query History Type .clear-afred-query-history in Alfred. Icon Credits Icon created by combining icons form flaticon made by Freepik and Pixel Perfect JJJJ and cands 2
Chris Messina Posted December 1, 2020 Posted December 1, 2020 Wow... @Mr Pennyworth — can you conceptually explain your approach to this workflow? I've never seen something like this:
vitor Posted December 1, 2020 Posted December 1, 2020 2 hours ago, chris said: can you conceptually explain your approach to this workflow? It has a Script Filter for every letter, and every time you type something it appends it to a text file. Then it reads it back when you use the Hotkey. The smaller Script Filters are self-contained and simple, so you can easily inspect the code. 2 hours ago, chris said: I've never seen something like this There’s an older Workflow on the forum (I don’t recall its name) which (as far as I know) was the first to use this technique. But it only does it for numbers (which I find more reasonable) because it’s a converter. Chris Messina 1
Mr Pennyworth Posted December 2, 2020 Author Posted December 2, 2020 8 hours ago, chris said: I've never seen something like this The "Calculate Anything" workflow does this. Ingenious and brilliant, isn't it! Blew my mind when I saw it! https://github.com/biati-digital/alfred-calculate-anything Chris Messina 1
deanishe Posted December 2, 2020 Posted December 2, 2020 3 hours ago, Mr Pennyworth said: The "Calculate Anything" workflow does this. Ingenious and brilliant, isn't it! Thought the same when I saw it. So clever. I was wondering if you'd got the idea from that workflow or come up with it independently.
Mr Pennyworth Posted December 2, 2020 Author Posted December 2, 2020 (edited) Quote Thought the same when I saw it. So clever. I was wondering if you'd got the idea from that workflow or come up with it independently. OMG!! dayum! my bad at creating that impression! I so didn't come up with it independently! Learnt from that workflow and all credit belongs to them. I had mentioned it here but should've mentioned in our discussion the other day too! (which I just edited to reflect the origin of the idea) Edited December 2, 2020 by Mr Pennyworth
Mr Pennyworth Posted December 2, 2020 Author Posted December 2, 2020 Hey @chris, I'm not saying you've formed such an impression, but in case that you have, I want to clarify, if my understanding of how Alfred works is correct, that number of script filters in itself shouldn't be a performance concern. The calculator workflow needs to deal with numbers, so it has 10 script filters. This one needs to deal with all strings, so it has more than 40. That no way makes it 4 times worse. Imagine, instead of 40, I had added one script filter each for all the letters in extended ascii, or, for that matter, all the unicode code points that I want (that would mean hundreds, even thousand script filters). The important point is, all these filters are mutually exclusive. At any time, at most one of them is active. So, 40 or 400 or 4000 filters, performance implications are almost same (except for how much RAM alfred uses) as long as they remain super cheap in terms of individual filter performance (which is the case here), and as long as they don't overlap (which, again, is the case here). @Andrew, I'm curious... Am I totally off the mark here? Or it makes sense but not entirely? Or it makes a lot of sense?
Andrew Posted December 2, 2020 Posted December 2, 2020 @Mr Pennyworth While it's clever in concept, I'd personally discourage using the multi-Script Filter method you're using, even though it's unlikely to, in isolation, cause any performance issues with Alfred. If somebody installed multiple workflows which used the same method, then Alfred will be running multiple scripts on every keypress. There is definite scope for an enhanced native command history built in to Alfred. This would take some thought and design, and would be configurable and user opt-in. I would also think about a easy-on temporary private mode, much like a browser, to prevent typed queries being stored, and also allow for expiry. The history would be likely stored in an sqlite db so it could also be accessed by workflows where necessary. Further to this, one thing on my future plan is to allow users to specify specific workflow objects to be included in the default results. Again, this will require some thought as it should be a user who decides this, and not a workflow developer. This would facilitate workflows like this one, and Calculate Anything, to work without needing multiple script filters. At the point that this happens, Alfred may start profiling script tasks and warning if they are taking too long or consuming too much CPU. Cheers, Andrew vitor, Chris Messina, Mr Pennyworth and 2 others 5
snowy Posted September 9, 2022 Posted September 9, 2022 just wondering, is search history still in the works? It would be great to view the last 5-10 queries. I use the up arrow regularly, but often find its not the last 2 queries. and being able to just view them in a list would be great. thanks! henrik 1
henrik Posted November 29, 2022 Posted November 29, 2022 +1 on snowy. No entry shows up when using the workflow. For some reason, when you backspace a single character, the query box appears for a split second. Does anyone have an idea how to fix this lovely workflow?
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