Last active
May 21, 2019 19:59
-
-
Save jtatum/4733578 to your computer and use it in GitHub Desktop.
Use ATOMac to click various items in the menubar menu for Skype
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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