Documentation

Control DockDoor with AppleScript, the CLI, and third-party automation tools.

Quick Start

DockDoor has full AppleScript support. Every command follows the same pattern:

tell application "DockDoor" to <command>

Try it right now in Terminal:

osascript -e 'tell application "DockDoor" to show switcher'

This opens the Window Switcher. You can also get a full list of commands:

osascript -e 'tell application "DockDoor" to get help'

Command Reference

Preview Commands

CommandDescription
show preview "App"Show dock-style preview for an app
show preview "id" by "bundle"Look up app by bundle ID
show preview "123" by "pid"Look up app by process ID
hide previewHide the current preview window
show switcherOpen the Window Switcher

show preview also accepts optional parameters:

-- Show Safari preview at a specific position
tell application "DockDoor" to show preview "Safari" at "500,400"

-- Show by bundle ID with hover delay
tell application "DockDoor" to show preview "com.apple.Safari" by "bundle" with delay true

Window Actions

All window commands accept a window ID (number) or "active" for the frontmost window.

CommandDescription
focus window "active"Bring window to front
minimize window "active"Minimize / unminimize
close window "active"Close the window
maximize window "active"Fill the screen
hide window "active"Hide / unhide the app
toggle fullscreen "active"Toggle fullscreen mode
center window "active"Center on screen
position window "active" to "left"Snap to screen region

Position values: left, right, top, bottom, top-left, top-right, bottom-left, bottom-right.

-- Snap active window to the left half
tell application "DockDoor" to position window "active" to "left"

-- Close a specific window by ID
tell application "DockDoor" to close window "12345"

-- Center and focus a window
tell application "DockDoor"
    center window "67890"
    focus window "67890"
end tell

Querying Windows & Apps

These commands return JSON, making them easy to parse in scripts.

CommandDescription
list appsAll running apps with window counts
list windowsAll windows across all apps
list windows "Safari"Windows for a specific app
get active windowInfo about the frontmost window
get window "12345"Window info with cached preview image (base64)
get windowsAll windows with preview images
-- Get active window info
osascript -e 'tell application "DockDoor" to get active window'

-- List all Safari windows (returns JSON)
osascript -e 'tell application "DockDoor" to list windows "Safari"'

-- List all apps
osascript -e 'tell application "DockDoor" to list apps'

Third-Party Integration

Logitech Options+, BetterTouchTool & Other Macro Tools

If you use software that maps mouse buttons or macros to keyboard shortcuts, you may find that DockDoor's Window Switcher doesn't respond. This happens because macro software often simulates key presses differently than a physical keyboard — the modifier key (Option, Command) is pressed and released instantly rather than held down.

The fix is to use DockDoor's AppleScript command instead of simulating a keyboard shortcut:

Map your mouse button to run this AppleScript:

tell application "DockDoor" to show switcher

This opens the Window Switcher directly, bypassing keyboard event detection entirely. It works with any automation tool that can run AppleScript.

Setup: Logitech Options+

  1. Open Logi Options+ and select your mouse
  2. Click the button you want to customize
  3. Choose Smart Actions
  4. Add an action → select AppleScript
  5. Paste: tell application "DockDoor" to show switcher

Setup: BetterTouchTool

  1. Open BetterTouchTool preferences
  2. Select your input device and add a new trigger
  3. Set the action to Run AppleScript (blocking)
  4. Paste: tell application "DockDoor" to show switcher

Setup: Karabiner-Elements

In your karabiner.json complex modification, use shell_command:

{
    "type": "basic",
    "from": { "key_code": "tab", "modifiers": { "mandatory": ["option"] } },
    "to": [
        { "shell_command": "osascript -e 'tell application \"DockDoor\" to show switcher'" }
    ]
}

CLI Usage

Every AppleScript command can be run from Terminal with osascript -e:

# Open the window switcher
osascript -e 'tell application "DockDoor" to show switcher'

# Show preview for an app
osascript -e 'tell application "DockDoor" to show preview "Finder"'

# Snap active window to right half
osascript -e 'tell application "DockDoor" to position window "active" to "right"'

# Get all windows as JSON
osascript -e 'tell application "DockDoor" to list windows'

# Get built-in help
osascript -e 'tell application "DockDoor" to get help'