Thursday, December 14, 2017

#1 2015-07-08 03:35:05 pm

WePiphany
Member
Registered: 2015-07-08
Posts: 1

Click a Button, Every 5 Minutes

I have an Android emulator that lets me platy Android games on my Mac (sweet!). The trouble is, it tends to loose the network connection very often, prompting a popup/error message with a button.

I would like to check to see of the error has occurred every 5 minutes, and if so, click the button.

I've attached a diagram of what I am trying to accomplish, along with a script that I have been experimenting with.

DIAGRAM:
appleScriptHelp-clickButton.png

SCRIPT:
[code]activate application "BlueStacks"
tell application "System Events" to tell process "BlueStacks"
     #buttons 1, 2 & 3 are close, shrink & maximize
     #how do I get to the “Try Again” button?
     click button 4 of window "BlueStacks App Player"
end tell[/code]
QUESTIONS:
1. How do I get line 5 to target the 'Try Again' button?
2. How do I get this script to run/repeat every 5 minutes so I never get knocked off line for too long?
3. I tried "button 4" assuming that it went linearly: 1, 2, 3, 4, etc. like a button array… but that was not the case.

P.S. I am new to Apple Script, but I get the concept and have tried many things in the past, eventually getting them to work. I am a front-end web developer and UX/UI designer, so I am close to getting it, I just am not familiar with Apple Script.

Last edited by WePiphany (2015-07-08 03:47:26 pm)


Filed under: Button, repeat, click

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)