Coming from Alfred
How Alfred's workflows, keywords, script filters, web searches and feature hotkeys map to Switchboard, and what the import keeps, notes or leaves out.
Alfred runs a workflow when you type its keyword, press its hotkey or call it from another workflow. Switchboard's palette (⌥Space) does the same with a macro that has a keyword, so gh swift actors still opens the GitHub search. Import reads Alfred's open formats and shows a review first; nothing is added until you click Import.
Choose File › Import… and pick:
a
.alfredworkflowfile (double-click one in Finder, or export it from Alfred), or a workflow folder;the
Alfred.alfredpreferencesfolder (Alfred › Preferences › Advanced shows where it lives): every workflow in it, your custom web searches, the hotkeys of Clipboard History and File Search, and your snippets;or
switchboard import file.alfredworkflow,switchboard import --alfred(the preferences on this Mac),--dryto read the review as JSON.
Importing the same thing again replaces the macros and adds no duplicates.
How a workflow reads #
A workflow is one group. Each trigger or input in it (a keyword, a hotkey, an external trigger) is one macro, and the objects connected after it become its steps, in the order of the connections.
Keywords keep their text. The macro has a query input; whatever you type after the keyword goes into it. A required argument opens the form when you press Return without one.
Hotkeys become hotkey triggers. Alfred's "argument" option (selection, clipboard, text) becomes the query. A selection is read by pressing ⌘C first, which replaces your clipboard.
Script filters run their script once with the text after the keyword and show the items it prints as a list. Your pick's
argis the query for the next step, and itsvariablesbecome variables. Alfred re-runs the script on every keystroke; live filtering is a later palette feature.Conditionals become If steps. Two outgoing connections are then and else.
A connection taken with a modifier key (⌘↩ does something else) becomes a list that asks which action. The palette has no per-row modifier keys yet.
Several connections out of one object run one after another, each in its own group, with a note.
Calling another workflow becomes Run Macro when that workflow is part of the same import.
Scripts and variables #
A script gets $query and {query} as the typed text, and each workflow variable it names as an environment variable, so $1, $query, {var:token} and $token all work. The values reach the script as data, never pasted into the shell text, so a quote in what you type cannot break it. Scripts in other languages (Python, Ruby, PHP, Perl, AppleScript, JavaScript) are run from a temporary file with the query as the first argument; when one has {query} pasted into its source, as Alfred does, the review says so.
A workflow's own settings: plain values become variables set at the start of each macro. Anything labelled API key, token, password or secret is asked for once, by a Set up … macro in the group (run it from the palette), and stored in the Keychain. It is never written into a macro or the review.
What each object becomes #
| Alfred object | Becomes | Fidelity |
|---|---|---|
trigger.hotkey | a hotkey trigger; the argument option becomes the query | mapped |
trigger.keyword | a palette keyword and a query input | mapped |
trigger.external | a macro other macros run (runMacro) | mapped |
trigger.action | a macro run by name (Universal Actions have no equivalent) | attention |
trigger.fallback | a macro run by name; turn on Fallback in its palette settings | attention |
trigger.snippet | a macro run by name | attention |
trigger.remote | a macro run by name (Alfred Remote has no equivalent) | attention |
trigger.contact | a macro run by name (Contacts triggers have no equivalent) | attention |
input.keyword | a palette keyword and a query input | mapped |
input.scriptfilter | the script, a list prompt of its items, the pick's arg as the query | attention |
input.filefilter | a file chooser | attention |
input.listfilter | a list prompt of the fixed items | mapped |
input.dictionary | nothing (Alfred's dictionary lookup) | unsupported |
action.script | a shell step, or the script run by its interpreter | mapped |
action.applescript | an appleScript step | mapped |
action.openurl | an openURL step | mapped |
action.openfile | an openFile step | mapped |
action.launchfiles | openFile steps | mapped |
action.revealfile | a file.reveal step | mapped |
action.browseinalfred | an openFile step (Alfred's file browser has no equivalent) | attention |
action.terminalcommand | a Terminal window running the command | attention |
action.systemcommand | the system step of the same name | mapped |
action.runworkflow | a runMacro step | mapped |
action.defaultwebsearch | an openURL web search | attention |
action.callautomation | nothing (Automation Tasks) | unsupported |
action.itunescommand | nothing (Alfred's Music commands) | unsupported |
utility.conditional | an if step | mapped |
utility.filter | the text passes through | attention |
utility.delay | a wait step | mapped |
utility.argument | variable steps for the query and variables | mapped |
utility.junction | nothing: the branches join | mapped |
utility.split | a group per branch, run in order | attention |
utility.debug | nothing | mapped |
utility.transform | a text step that changes nothing: pick the transform | attention |
utility.replace | a text replacement on the query | mapped |
utility.json | a variables.fromJSON step | attention |
utility.hotkeycombination | a pressKeys step | mapped |
output.clipboard | a clipboard step | mapped |
output.notification | a notify step | mapped |
output.largetype | a hud step | mapped |
output.playsound | a shell step running afplay | mapped |
output.aftertext | a typeText step | mapped |
Fidelity: mapped reads the same, attention works with a difference the review names, unsupported is left out with a note.
Hotkeys and take over #
Alfred still owns its hotkeys while it runs. Keyword macros come in on; anything with a hotkey comes in off. When you have turned the workflow off in Alfred, tick Take over in the review (or --take-over) to switch them on.
What is not imported #
Alfred Remote, themes and appearance, Alfred's file navigation window, Automation Tasks, Universal Actions and Contacts triggers (the macro is kept, run by name), and the Music commands. A number-coded System Command is left out rather than guessed: add it from the palette's System rows (Sleep, Lock Screen, Empty Trash and the rest).
See also #
Coming from TextExpander or Alfred, Coming from Raycast, Open URL, Ask for input, Keychain password