Skip to content

Per app search customization

Benzi edited this page Mar 29, 2023 · 2 revisions

In addition to the workflow user configurations (v2.0 and above) that you can tweak to modify global behaviour, you can control app-level search settings.

There is some manual configuration required, so follow along below.

Getting started

  • First, access the settings menu by typing ms into Alfred.
Screenshot 2023-03-30 at 00 06 51
  • This should display three results: an entry to the workflow's settings folder, a sample settings.txt file, and an entry to the cache folder.

  • You can open the sample settings file to have a look at the configuration format in detail, and use it as a general reference.

  • To enable customization, you need to create a new settings.txt file in your Settings Folder

    • To access the settings folder from Alfred, type ms and press Right Arrow key when on the Settings Folder result
    • This should open the Alfred commands screen, and you should be able to open the folder in Finder (Choose Reveal in Finder)
Screenshot 2023-03-30 at 00 14 34
  • Once you have the settings folder opened, create a new empty text file, and name is settings.txt.

  • While the sample settings file has details, here is a simple example file that prevents showing menu items from the History and Bookmark → Favourites menus:

appFilters {
    app: "com.apple.Safari"
    ignoreMenuPaths {
        path: "History"
    }
    ignoreMenuPaths {
        path: "Bookmarks"
        path: "Favourites"
    }
}

Explanation

A line by line explanation of the sample follows.

appFilters {

beginning of any app-specific configuration

    app: "com.apple.Safari"

specify the id of the app. You can find the correct id by going to the cache folder via ms command in Alfred after you have searched for menus from the app of your choice at least once. For Safari, the id will be com.apple.Safari, and you should find files named com.apple.Safari.menus and com.apple.Safari.cache. You can strip the last .menus or .cache bits to identify the app id.

    ignoreMenuPaths {
        path: "History"
    }

This specifies you do not want any menu (and sub menu) items from the History menu listed in your search

    ignoreMenuPaths {
        path: "Bookmarks"
        path: "Favourites"
    }

This specifies you do not want any menu items from Bookmark → Favourites menu (but can include any other menu items under Bookmark menu)

}

This last bracket closes off the app specific configuration. In this example, for Safari. To begin another app specific configuration, begin with a new section in a new line at the end of the file. Refer again to the sample settings file.

Once you have created your settings.txt file and placed it in the settings folder, the workflow will automatically read those settings and your filter your search results as per the app settings configured.

Errors

If you have a typo in your settings file, you'll see an error when you search for menu items.

Some illustrative examples below, but you would need to manually verify what is wrong with your settings.txt file.

Screenshot 2023-03-30 at 00 30 54

usually indicates a typo in the sub-setting field names, or a missing } between sections

Screenshot 2023-03-30 at 00 31 48

usually means a missing } at the end of the file

Screenshot 2023-03-30 at 00 33 34

usually shown if you have typed true for some the toggle fields inside quotes, e.g. showDisabledMenuItems: "true" instead of showDisabledMenuItems: true

Clone this wiki locally