Advertisement
Guest User

Untitled

a guest
May 27th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. # to use in python you must pip install uiautomation but my guess is its same method
  2.  
  3. from time import sleep
  4. import uiautomation as automation
  5.  
  6. if __name__ == '__main__':
  7. sleep(3)
  8. control = automation.GetFocusedControl()
  9. controlList = []
  10. while control:
  11. controlList.insert(0, control)
  12. control = control.GetParentControl()
  13. if len(controlList) == 1:
  14. control = controlList[0]
  15. else:
  16. control = controlList[1]
  17. address_control = automation.FindControl(control, lambda c, d: isinstance(c, automation.EditControl) and "Address and search bar" in c.Name)
  18. print (address_control.CurrentValue())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement