Control DockDoor with AppleScript, the CLI, and third-party automation tools.
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 | Description |
|---|---|
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 preview | Hide the current preview window |
show switcher | Open the Window Switcher |
show preview also accepts optional parameters:
at "x,y" — position the preview at specific coordinatesdock frame "x,y,w,h" — position relative to a dock icon rectwith delay true — use the configured hover delay-- 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
All window commands accept a window ID (number) or "active" for the frontmost window.
| Command | Description |
|---|---|
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
These commands return JSON, making them easy to parse in scripts.
| Command | Description |
|---|---|
list apps | All running apps with window counts |
list windows | All windows across all apps |
list windows "Safari" | Windows for a specific app |
get active window | Info about the frontmost window |
get window "12345" | Window info with cached preview image (base64) |
get windows | All 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'
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.
tell application "DockDoor" to show switchertell application "DockDoor" to show switcherIn 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'" }
]
}
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'