Move OSX Dock Position

How can I create a macro to move the Mac OSX Dock position from bottom to right when a short cut key is pressed (or better still, when an external monitor is attached). Thanks

I just came across an AppleScript to toggle the position of the Dock without using killall Dock

If the dock is on the bottom, it will move it to the right.

If the dock is on the right, it will move it to the bottom.

tell application "System Events" to tell dock preferences
	if screen edge is bottom then
		set screen edge to right
	else if screen edge is right then
		set screen edge to bottom
	end if
end tell

Note that it can take a few seconds to toggle.

Use an “Execute AppleScript” block.

I use ⌥D since ⌘⌥D is “Hide/Unhide Dock”

I'm not sure if there's a Keyboard Maestro way to trigger when an external monitor is connected/disconnected.

3 Likes

great thank you!!!

This works perfectly in Big Sur. Thanks!

1 Like

The following trigger will likely work for you.

I use it for macros that I run on my iMac (which has an additional monitor hooked up) as well as my MacBook (which I do not use an external monitor with).