prefs

class afwf.alfred.prefs.AlfredPreferences[source]

Reads Alfred’s prefs.json to locate the active Alfred preferences folder and its nested workflow directories.

All attributes are lazily evaluated and cached on first access.

~/Library/Application Support/Alfred/prefs.json example:

{
  "current": "/Users/you/Documents/Alfred-Settings/Alfred.alfredpreferences",
  "localhash": "eca048243db0aaa88c88989d699c5ff94a75b844",
  "syncfolders": {
    "5": "~/Documents/Alfred-Settings"
  }
}
property path_prefs_json: Path

Path to ~/Library/Application Support/Alfred/prefs.json.

property dir_alfred_preferences: Path

The active Alfred preferences folder (Alfred.alfredpreferences).

Resolved from the current key in prefs.json.

property dir_workflows: Path

The workflows/ directory inside the active Alfred preferences folder.

All user workflows live here as sub-folders named user.workflow.<UUID>.

get_workflow(workflow_id: str) AlfredWorkflow[source]

Return an AlfredWorkflow for the given UUID.

Parameters:

workflow_id – The workflow UUID, e.g. "76458317-5B0A-40E7-A328-DC6C900EC1B9".

list_workflows() list[source]

Return a list of AlfredWorkflow objects for every workflow folder found in dir_workflows.