Skip to content

Instantly share code, notes, and snippets.

@jtatum
Last active May 21, 2019 19:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jtatum/4733578 to your computer and use it in GitHub Desktop.
Save jtatum/4733578 to your computer and use it in GitHub Desktop.
Use ATOMac to click various items in the menubar menu for Skype
import atomac
a=atomac.getAppRefByLocalizedName('Skype')
cloud_menu = a.AXChildren[2].AXChildren[0]
print cloud_menu
# Some apps are coded so menu items aren't populated until they're displayed
try:
cloud_menu.Press()
except atomac.ErrorCannotComplete:
# An accessibility bug you'll see sometimes - the app never reports
# back on accessibility actions
pass
# There are two menu items called "away" - the second one is in the cloud menu
away=a.findAllR(AXTitle=u'Away')[1]
print away
away.Press()
try:
cloud_menu.Press()
except atomac.ErrorCannotComplete:
# An accessibility bug you'll see sometimes - the app never reports
# back on accessibility actions
pass
print a.findAllR(AXTitle='Online')
# Again, the second one is the one we need
a.findAllR(AXTitle='Online')[1].Press()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment