Newbie to applescript, sorry if its dumb. I have been trying to write a script to check if the network is healthy, if not go to a url and click Login button on the webpage (actually the page has 'username' and 'password' which my browser autofills). i used the following code;
try
set thePing to do shell script "/sbin/ping -o -c 1 www.google.com"
on error
tell application "Google Chrome" to open location "https://mwcp-ekm-04.adlkerala.com:8001"
delay 5
tell application "System Events"
tell process "chrome"
click at {585, 220}
end tell
end tell
end try
(I know a javascript would have been better that the 'Click at' but then i didnt know how to do that)
While running i get the following error "System Events got an error: Can’t make {585, 220} into type list." number -1700 from {585, 220} to list"
EDIT:
after some googling i managed to pull out the java code;
try
set thePing to do shell script "/sbin/ping -o -c 1 www.google.com"
on error
tell application "Safari" to open location "https://mwcp-ekm-04.adlkerala.com:8001"
delay 3
tell application "Safari"
do JavaScript "document.getElementById('submit').click();" in current tab of first window
end tell
but now this returns a result "Missing Values"
end try
i would appreciate any help
Thanks