Overview
Loop supports URL scheme commands for window management and automation. All commands use the base format:All commands are case-insensitive and operate on the frontmost non-terminal window.
Base URL Format
Must be
loopThe command type:
direction, screen, action, keybind, or listCommand-specific parameters (varies by command type)
Direction Commands
Move or resize windows using directional commands.Endpoint
Parameters
The direction to move or resize the window. Supports both short and full names.Basic directions:
left- Move window to left halfright- Move window to right halftop- Move window to top halfbottom- Move window to bottom halfmaximize- Maximize windowcenter- Center window
leftHalf, rightHalf, topHalf, bottomHalf)Examples
Response
Window is moved/resized to the specified direction. No return value.
Error Responses
Returns error message to console/log:
"No direction specified"- Missing direction parameter"Invalid direction: <value>"- Unknown direction value"No suitable windows or screen found"- No eligible window to operate on
Screen Commands
Move windows between multiple displays.Endpoint
Parameters
Screen movement command:
next- Move window to next screenprevious- Move window to previous screen
Examples
Response
Window is moved to the target screen. No return value.
Error Responses
Returns error message to console/log:
"No screen command or window"- Missing parameter or no active window"Failed to find target screen"- No available screen in requested direction
Action Commands
Execute predefined window actions or custom actions.Endpoint
Parameters
The action to execute. Can be:Predefined actions:
- Any WindowDirection value (e.g.,
maximize,leftHalf,rightHalf) - See
loop://list/actionsfor complete list
- Any custom action name you’ve defined in Loop settings
- Custom action names are case-insensitive
- Any stash action name you’ve defined
Examples
Response
Action is executed on the target window. No return value.
When using
loop://action/list, opens a temporary text file with categorized actions:- Custom Actions
- Stash Actions
- General Actions
- Halves
- Quarters
- Horizontal Thirds
- Vertical Thirds
- Screen Switching
- Size Adjustment
- Shrink
- Grow
- Move
- Other
Error Responses
Returns error message to console/log:
"Invalid action: <value>"- Unknown action name"Could not find a suitable window to apply the custom action"- No eligible window
Keybind Commands
Execute custom keybind actions by name.Endpoint
Parameters
The name of the custom keybind to execute. Must match a keybind name defined in Loop settings.
- Names are case-insensitive
- Use
loop://keybind/listorloop://list/keybindsto see available keybinds
Examples
Response
Keybind is executed on the target window. No return value.
When using
loop://keybind/list, prints available keybind names to console.Error Responses
Returns error message to console/log:
"No keybind specified"- Missing name parameter"Keybind not found: <name>"- No keybind with that name exists
List Commands
View available commands, actions, and keybinds.Endpoint
Parameters
The type of items to list:
actions- List all window actions (predefined and custom)keybinds- List all custom keybindsall- List all commands, actions, and keybinds
Examples
Response
Opens a temporary text file (auto-deleted after 60 seconds) containing:
loop://list/actions:
- Custom Actions (if any defined)
- Stash Actions (if any defined)
- General Actions
- Halves (leftHalf, rightHalf, topHalf, bottomHalf)
- Quarters (topLeft, topRight, bottomLeft, bottomRight)
- Horizontal Thirds
- Vertical Thirds
- Screen Switching (nextScreen, previousScreen)
- Size Adjustment
- Shrink
- Grow
- Move
- Other
loop://list/keybinds:
- All named custom keybinds with their URL format
loop://list/all:
- All direction commands
- All screen commands
- All actions (custom and predefined)
- All keybind commands
- All list commands
Error Handling
Invalid Scheme
If the URL scheme is notloop://, returns:
Invalid Command
If the command is not recognized, returns:Missing Parameters
Each command type provides specific guidance when parameters are missing. For example:Window Selection
Loop automatically selects the target window using this priority:- User-defined target - Window selected via Loop’s target window mechanism
- Last active window - Window that was active within the last 5 seconds
- Frontmost window - First eligible window in the window list
Eligible Windows
Windows must meet these criteria:- Not the Loop application itself
- Regular activation policy (not background-only apps)
- Visible (not hidden or minimized)
Usage Tips
Integration Examples
Shell Script
Keyboard Maestro
Alfred Workflow
Hammerspoon
Command Reference Table
| Command | Format | Description |
|---|---|---|
| Direction | loop://direction/<direction> | Move/resize window |
| Screen | loop://screen/<next|previous> | Move between displays |
| Action | loop://action/<action> | Execute predefined or custom action |
| Keybind | loop://keybind/<name> | Execute named keybind |
| List | loop://list/<type> | View available commands |