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
| Action | What it does |
|---|---|
| Open apps | Launches the apps you add, a moment after the switch so their windows open on this Space |
| Open URL or file | Opens web links, other apps' URL schemes or paths such as ~/Documents/Invoices |
| Hide apps that have no window here | Hides everything that is not on this Space (Finder is left alone) |
| Send keystroke | Sends a key combination to the front app, written like cmd+shift+1 or f5 |
| Browser profile | Opens a Chrome, Brave, Edge, Vivaldi or Arc profile by its folder name, such as "Default" or "Profile 1" |
| Run Shortcut | Runs a shortcut from the Shortcuts app by name |
| Run shell command | Runs 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:
| Variable | Value |
|---|---|
SPACEPAL_SPACE_NAME | The Space's name |
SPACEPAL_SPACE_NUMBER | Its desktop number (empty for full screen Spaces) |
SPACEPAL_SPACE_ID | Its 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
- Profiles save a whole set of names, colours, notes and automations, for example Work and Home. Switch from the menu, with
spacepal://profile/Work, or automatically when a particular set of displays is connected. - Templates set up several Spaces in one go. Spacepal ships five: Developer, Designer, Freelancer, Student and Streamer. Each fills your desktops in order with names, icons, colours and, for some Spaces, apps to open when the Space is empty. You can also import a template file. If a template wants more desktops than you have, Spacepal tells you how many to add. See the use cases for what each template contains.
Turning it off
"Run Space automations" in Settings, General pauses all of them at once without deleting anything.
Mac App Store differences
- No shell commands, in or out.
- Shortcuts run through the Shortcuts app via a
shortcuts://link instead of in the background. - Browser tabs are not saved when you save and close a Space.
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.