Use Spacepal from Alfred
There is no ready-made Spacepal workflow for Alfred yet, but you do not need one. Every Spacepal action is a spacepal:// link, so a Custom Web Search or a two-step workflow switches Spaces by name. A Script Filter that reads Spacepal's state.json gives you a searchable list of every Space. Workflows need the Alfred Powerpack; the Custom Web Search works without it.
Quickest: a Custom Web Search
In Alfred Preferences, Features, Web Search, choose Add Custom Search and set:
| Field | Value |
|---|---|
| Search URL | spacepal://switch/{query} |
| Title | Switch to Space {query} |
| Keyword | sp |
Now sp mail goes to your Mail Space and sp 3 to Desktop 3. Names match exactly first, then by the start of the name, then anywhere in it. Alfred normally opens web searches in your browser; custom URL schemes such as spacepal:// should be handed to Spacepal instead, but if your browser opens, use the workflow below.
A workflow: keyword to Open URL
- Create a blank workflow and add a Keyword input, for example
sp, with "Argument Required". - Connect it to an Open URL action with the URL
spacepal://switch/{query}. - Add more keywords the same way:
spwwithspacepal://move-window/{query}to send the front window,spowithspacepal://overview.
A Run Script action with /bin/zsh works too, and keeps Spacepal from coming to the front:
open -g "spacepal://switch/$1"
A searchable list of Spaces (Script Filter)
Spacepal rewrites state.json whenever your Spaces change. It lists each Space's name, desktop number, note, color, apps and whether it is active. A Script Filter input can turn that into Alfred results. Use /bin/zsh, "with input as argv", and this script:
STATE="$HOME/Library/Application Support/Spacepal/state.json"
jq --arg q "${1:-}" '{items: [.spaces[]
| select(.isFullscreen | not)
| select(($q == "") or ((.name + " " + (.note // "") + " " + (.apps | join(" "))) | ascii_downcase | contains($q | ascii_downcase)))
| {uid: .id, title: .name,
subtitle: ("Desktop \(.number)" + (if .note then " · " + .note else "" end)),
arg: (.number | tostring)}]}' "$STATE"
Connect it to an Open URL action with spacepal://switch/{query}. Because the result passes the desktop number, names with spaces need no escaping. Add a second connection with the ⌘ modifier and spacepal://move-window/{query} to send the front window to the chosen Space instead.
jqis included with macOS 15 and later. On macOS 14, install it with Homebrew (brew install jq) and use its full path, such as/opt/homebrew/bin/jq.- The Mac App Store version keeps the file in its container:
~/Library/Containers/com.halberd.spacepal/Data/Library/Application Support/Spacepal/state.json.
Hotkeys
Alfred Hotkey triggers connected to Open URL give you extra shortcuts, for example a key for spacepal://back or spacepal://eject. Spacepal's own shortcuts (⌃⌥1 and so on) already cover switching, so use Alfred hotkeys for the actions that have none.
Limits
- Moving the front window works on every supported macOS version.
- Links that move windows that are not in front, such as
restore-layoutandeject, use a direct WindowServer move that works on macOS 14.0 to 14.4 and on 26.4 and later. On other versions those windows stay where they are.
Related
- Raycast
- The spacepal:// URL scheme
- All integrations
- Spacepal is a one-time purchase with a 14-day trial
Written by Dan Bayer, developer of Spacepal. Last updated 2026-10-27.