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:

FieldValue
Search URLspacepal://switch/{query}
TitleSwitch to Space {query}
Keywordsp

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

  1. Create a blank workflow and add a Keyword input, for example sp, with "Argument Required".
  2. Connect it to an Open URL action with the URL spacepal://switch/{query}.
  3. Add more keywords the same way: spw with spacepal://move-window/{query} to send the front window, spo with spacepal://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.

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

Related

Written by Dan Bayer, developer of Spacepal. Last updated 2026-10-27.