Jump to content

Search Safari History


Recommended Posts

Posted

Welcome @drylight,

 

I have a workflow close to ready that does this. No ETA on the release date yet, as I want to add a few more features. But here’s a pared down version:

 

All you need is a Script Filter Input with Argument Optional and this Script:

 

/usr/bin/sqlite3 \
  "${HOME}/Library/Safari/History.db" \
  "SELECT JSON_OBJECT(
    'items', JSON_GROUP_ARRAY(JSON_OBJECT(
      'title', IIF(title IS NULL OR title IS '', url, title),
      'subtitle', url,
      'arg', url,
      'match', title || ' ' || url)))
  AS JSON_RESULT FROM (
    SELECT url, title
      FROM history_items
      INNER JOIN history_visits ON history_visits.history_item = history_items.id
      GROUP BY url
      ORDER BY visit_time
      DESC LIMIT 3000)"


Connect it to an Open URL Action, and you’re done.

 

See the Getting Started Guide for an interactive tutorial on making a workflow. There is further documentation on the website to follow up (tip: find help for any object fast by clicking the (?) icon while editing). You may also be interested in the YouTube channel, the Simple Ideas series of forum posts, or the learning workflows in the Alfred Gallery.

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...