3

background

I'm a heavy user of chrome custom search engines (you can see an example of such usage here). However, I like the convenience of alfred and would like to simply launch websites from alfred.

Alfred also offers it's own custom search functionality that's very similar to chrome:

problem

I know that chrome's custom search engines are stored as a sqlite database here

~/Library/Application Support/Google/Chrome/Profile/Web Data

how can i simply export this (gigantic) list of custom search engines to alfred?

Community
  • 1
  • 1
abbood
  • 23,101
  • 16
  • 132
  • 246

1 Answers1

3

Adding some information that may help get to the resolution:

The location of the "Web Data" sqlite file for me was in a slightly different location for me: ~/Library/Application Support/Google/Chrome/Default/Web Data

Using this free software,SQLPro for SQLite Read-Only (sql and coredata manager/editor), which you can get form the Mac App Store, you can drop the Web Data file onto it. Then go to the "keywords" table with the "Data" tab at the top selected. You should see all the custom search engine information here. Next, click "Data" (file menu) > "Export" and choose a type to export. It's easier for me to work with CSV or JSON data.

You can remove columns in a spreadsheet app or parse through it and take the pieces you need. You can automate the input process from the data file to Alfred with scripting (Ex: AppleScript). Don't know right now about where Alfred stores it's "Web Search" data. If you can alter the file in Alfred directly it will be quicker and less prone to automation bugs. Sorry, I do not have a script at this time to input into Alfred.

2 cents: I also like having an Alfred Web Search version of the Google Custom Search Engine (CSE). In Chrome, the current tab goes to the search result. When using Alfred, the search result is opened in a new tab on the default browser (which is chrome for me). I understand that I could Ctrl+T and then use the engine but Alfred is used out of habit.

EDIT: I wanted to mention that you won't find %s for the search term placedholder, which is used when you create the CSE in Google Chrome. Instead you'll see {searchTerms}.

Example:

https://duckduckgo.com/?q={searchTerms}

Be careful that other CSE urls may require some sanitizing before you can put into Alfred. For example, the chrome-stocked Google search one uses some reserved functions/keywords - all my custom ones were normal it seems:

{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:iOSSearchLanguage}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}{google:contextualSearchVersion}ie={inputEncoding}

toha
  • 5,095
  • 4
  • 40
  • 52