Skip to main content
Loop can be controlled using AppleScript, allowing you to integrate window management into your macOS automation workflows.

Basic AppleScript Commands

Activating Loop

Bring Loop to the foreground:
tell application "Loop" to activate
Shell execution:
osascript -e 'tell application "Loop" to activate'

URL Scheme Integration

Execute Loop commands using the URL scheme:
open location "loop://direction/left"
Shell execution:
osascript -e 'open location "loop://direction/left"'

Common Use Cases

Window Positioning

Move windows to specific positions:
# Move window to right half
osascript -e 'open location "loop://direction/right"'

# Move window to left half
osascript -e 'open location "loop://direction/left"'

# Maximize window
osascript -e 'open location "loop://action/maximize"'

Screen Management

Move windows between displays:
# Move to next screen
osascript -e 'open location "loop://screen/next"'

# Move to previous screen
osascript -e 'open location "loop://screen/previous"'

Integration with Other Tools

Keyboard Maestro

Create a Keyboard Maestro macro that executes AppleScript:
  1. Create a new macro
  2. Add “Execute AppleScript” action
  3. Use the AppleScript command:
open location "loop://direction/right"

Alfred Workflows

Create an Alfred workflow that runs AppleScript:
  1. Create a new workflow
  2. Add a “Run Script” action
  3. Set language to “AppleScript”
  4. Add your Loop commands

Automator

Create Automator workflows with Loop commands:
  1. Create a new Automator workflow
  2. Add “Run AppleScript” action
  3. Include Loop URL scheme commands

Shell Scripts

Combine AppleScript with shell scripts for more complex automation:
#!/bin/bash

# Activate Loop
osascript -e 'tell application "Loop" to activate'

# Execute window command
osascript -e 'open location "loop://direction/right"'

Tips

All Loop URL scheme commands can be executed through AppleScript using the open location syntax.
For quick one-off commands, use osascript -e directly from the terminal.
Chain multiple commands together in a single AppleScript or shell script for complex workflows.

Next Steps

URL Scheme Reference

Complete URL command reference

Scripting Examples

Real-world automation examples

Build docs developers (and LLMs) love