Jump to content

Recommended Posts

Posted

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 :)

Posted

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.

Posted

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

I could see it being implemented in the way clipboard history works. Perhaps even history snippets.

  • 2 years later...
Posted

Bump.

 

I could probably implement a workflow to do this provided that:

 

1. I can access the query history (currently unclear where this is stored)

2. The number of stored items (currently 20) can be customized

 

I think this would be a really useful feature

Posted

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.

  • 10 months later...
Posted

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.

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
×
×
  • Create New...