Jump to content

Search for typed query history


zhaowu
 Share

Recommended Posts

It should be easy to implement and very useful. Once you have typed lots of queries, you probably just keep repeating.

 

Do you mean a history feature for what you enter into Alfred? That's already available by pressing the up-arrow on an empty search box; it holds the last 20 items

 

Cheers :)

Link to comment
Share on other sites

Do you mean a history feature for what you enter into Alfred? That's already available by pressing the up-arrow on an empty search box; it holds the last 20 items

 

Cheers :)

Yes, but I would like to search for them. and I would like to search for more history queries. up-arrow are too slow.

Link to comment
Share on other sites

  • 2 years later...

It's not possible to search Alfred's history with a workflow because Alfred only keeps its history in memory. When you restart Alfred, the history is reset.
 
You can extract some of the information from the knowledge.alfdb file in ~/Library/Application Support/Alfred 2/Databases.
 
It's a normal sqlite3 database, and you can grab the last 20 queries with the following shell command: 

sqlite3 "$HOME/Library/Application Support/Alfred 2/Databases/knowledge.alfdb" 'SELECT keyword from knowledge WHERE hidden is NULL ORDER BY ts DESC LIMIT 20;'

To get the last 50 results, change LIMIT 20 to LIMIT 50 and so on.

 

However, this will only get you the full query (keyword + argument) for built-in actions. For workflows, only the keyword is stored in the database. If you also wanted to show the appropriate icon, you'd have to parse all installed workflows to build a UUID-icon map.

 

And it goes without saying that the database format may change at any time because it's an implementation detail and not part of the API.

 

All in all, it's probably not possible to build a particularly useful workflow to search Alfred's history.

Link to comment
Share on other sites

  • 10 months later...

Curious if anything's changed since then. I'm a newcomer to Alfred and using another app, I'm used to cmd-B to show recent queries, or when executing a web search using a different shortcut to repeat the last search for example using a different search engine or site, cmd-space. Likely I haven't learned all the shortcuts yet, but it seems there are many available for future commands.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...