Skip to content

Instantly share code, notes, and snippets.

@tuan
Last active March 6, 2022 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuan/9e74b1650b120d192c068313a5db178f to your computer and use it in GitHub Desktop.
Save tuan/9e74b1650b120d192c068313a5db178f to your computer and use it in GitHub Desktop.
Alfred Safari History Search
sqlite3 ~/Library/Safari/History.db "select json_object('items', json_group_array(json_object('quicklookurl', url, 'uid', title, 'title', title, 'subtitle', url, 'arg', url))) as json_result from (select v.title, i.url, i.visit_count_score from history_items i join history_visits v on (v.history_item = i.id and i.domain_expansion || v.title LIKE '%' || replace('{query}', ' ','%') || '%') group by v.title order by v.visit_time desc)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment