Skip to content

A simple AppleScript to reveal System Settings’ anchors

I stumbled upon this simple AppleScript while looking for something else, but it's incredibly useful for scripting System Settings…so I'm posting it here in case the original site ever goes away.

To get the names of all the anchors for a selected pane in System Settings, just run this in Script Editor:

Run that on the Desktop pane, for instance, and the output is this:

{anchor "Dock" of pane id "com.apple.Desktop-Settings.extension" of application "System Settings", anchor "HotCorners" of pane id "com.apple.Desktop-Settings.extension" of application "System Settings", anchor "MenuBar" of pane id "com.apple.Desktop-Settings.extension" of application "System Settings", anchor "MissionControl" of pane id "com.apple.Desktop-Settings.extension" of application "System Settings", anchor "Shortcuts" of pane id "com.apple.Desktop-Settings.extension" of application "System Settings", anchor "StageManager" of pane id "com.apple.Desktop-Settings.extension" of application "System Settings", anchor "WindowsApps" of pane id "com.apple.Desktop-Settings.extension" of application "System Settings"}

With that information, you can jump directly to a given area in AppleScript with code like this:

I'd always wondered how people found the anchor names, and now I know.

2 thoughts on “A simple AppleScript to reveal System Settings’ anchors”

  1. Very useful! Out of interest, what's the point of 'delay 0.5' at the end? Presumably if you just want to show a settings area it's not needed, but if your script is then going to do something you need a delay for the transition animation to finish?

  2. Yea, that's it—if you don't insert the delay, whatever steps you're going to take on that panel won't process as it's not been loaded. And depending on the speed of the Mac, you might have to vary the delay. (Though I think it's also possible to wait until something on the chosen pane is visible, which would be a better solution.)

    -rob.

Leave a Reply

Your email address will not be published. Required fields are marked *