Skip to main content
This page provides practical examples of automating Loop using shell scripts, AppleScript, and the URL scheme.

Shell Script Examples

Basic Window Movement

Simple commands for common window operations:

Sequential Actions

Chain multiple actions together with delays:
The sleep command ensures the first action completes before the next one starts.

Discovery Scripts

Query available commands and configurations:

AppleScript Examples

Activating Loop

Window Commands

Automation Workflows

Multi-Step Window Layout

Create a complete workspace layout:

Screen Management Workflow

Move windows between displays:

Integration Patterns

Combining URL Scheme and AppleScript

Use both approaches in the same script:

Keyboard Shortcut Automation

Create shell aliases for common operations:
Then use them directly:

Custom Keybind Execution

Trigger custom keybinds by name:

Advanced Examples

Conditional Window Management

Combine Loop with system queries:

Timed Automation

Create time-based window layouts:

Tips for Effective Scripting

Use sleep commands between sequential actions to ensure each command completes before the next starts. A delay of 0.3-0.5 seconds is usually sufficient.
Test individual commands before combining them into complex scripts. Use loop://list/all to verify available commands.
Create shell aliases for frequently used commands to speed up your workflow.
Window commands operate on the frontmost non-terminal window. Make sure the correct window is active before running commands.

Next Steps

URL Scheme Reference

Complete URL command documentation

AppleScript Integration

AppleScript automation guide