Automations for each Space

Each Space in Spacepal can do things when you enter it and when you leave it: open apps, URLs or files, run a Shortcut, run a shell command, send a keystroke, hide apps that have no window there, or open a specific browser profile. Set them in Settings, Spaces, or right-click a Space in the overview and choose "Automation and Details…".

When you enter a Space

ActionWhat it does
Open appsLaunches the apps you add, a moment after the switch so their windows open on this Space
Open URL or fileOpens web links, other apps' URL schemes or paths such as ~/Documents/Invoices
Hide apps that have no window hereHides everything that is not on this Space (Finder is left alone)
Send keystrokeSends a key combination to the front app, written like cmd+shift+1 or f5
Browser profileOpens a Chrome, Brave, Edge, Vivaldi or Arc profile by its folder name, such as "Default" or "Profile 1"
Run ShortcutRuns a shortcut from the Shortcuts app by name
Run shell commandRuns a command with zsh (direct version only)

Two switches control when apps and URLs open: Only the first time after login (on by default) and Only when the Space is empty. "Set Up This Space Now", in the menu bar, the overview or the editor, opens everything immediately, ignoring the first-time rule. The link spacepal://setup/3 does the same from a script.

When you leave a Space

You can run a Shortcut or a shell command when you leave, for example to pause music or turn off a Focus you turned on when entering.

Shell commands and their variables

In the direct version, commands run with /bin/zsh -lc, so your login shell's PATH applies. Spacepal sets three variables:

VariableValue
SPACEPAL_SPACE_NAMEThe Space's name
SPACEPAL_SPACE_NUMBERIts desktop number (empty for full screen Spaces)
SPACEPAL_SPACE_IDIts internal identifier
# Enter "Focus": quieter Mac
osascript -e 'set volume output muted true'
echo "$(date) entered $SPACEPAL_SPACE_NAME" >> ~/spaces.log

Output is discarded, so write to a file if you want to see it.

Shortcuts

Type the shortcut's name exactly as it appears in the Shortcuts app (the direct version also offers a list to pick from). The direct version runs it in the background with the shortcuts command. The Mac App Store version is sandboxed, so it opens a shortcuts:// link and the Shortcuts app runs it. Shortcuts is the easiest way to change Focus, Wi-Fi, dark mode or anything else Shortcuts can reach. See Shortcuts integration.

Apps that belong to a Space

Separate from automations, each Space can list apps whose new windows are always moved there, such as Slack to "Chat". Moving those windows uses a direct WindowServer move that works on macOS 14.0 to 14.4 and on 26.4 and later; on other versions they stay where they open. See Move windows.

Profiles and templates

Turning it off

"Run Space automations" in Settings, General pauses all of them at once without deleting anything.

Mac App Store differences

Everything else on this page works in both versions. Spacepal is a one-time purchase with a 14-day trial.

Related

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