Skip to content

Instantly share code, notes, and snippets.

@lululau
Created April 15, 2015 15:27
Show Gist options
  • Select an option

  • Save lululau/521af1d4d92543eee2b5 to your computer and use it in GitHub Desktop.

Select an option

Save lululau/521af1d4d92543eee2b5 to your computer and use it in GitHub Desktop.
tell application "System Events"
tell process "Dash"
tell first window
tell first group
set most_left_btn to first button
set most_left_frame to value of attribute "AXFrame" of most_left_btn
set most_left to first item of most_left_frame
repeat with btn in buttons
set frame to value of attribute "AXFrame" of btn
set lft to first item of frame
if lft < most_left then
set most_left_btn to btn
set most_left to lft
end if
end repeat
tell most_left_btn
perform action "AXPress"
end tell
end tell
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment