applescript

Lex


Joined
Nov 26, 2009
Messages
64
Reaction score
0
Points
6
So this morning I saw my sister play a game on her computer. I, kinda naively, told her i could automate the actions she did. The basic idea is that I want safari to click on 5 locations with some time interval. Here is what I wrote;

repeat 10 times
delay 2
tell application "System Events"
tell application process "Safari"
delay 2
click (click at {683, 378})
delay 2
click (click at {683, 378})
delay 2
click (click at {683, 378})
delay 2
click (click at {515, 489})
delay 2
click (click at {665, 417})
end tell
end tell
end repeat

however when I run it; I get no errors but nothing happens within safari.

Anyone can help me on this?

tnx
 
OP
L

Lex


Joined
Nov 26, 2009
Messages
64
Reaction score
0
Points
6
This is what I get when I run it;

tell application "System Events"
click application process "Safari" at {683, 378}
--> missing value
click missing value
click application process "Safari" at {683, 378}
--> missing value
click missing value
click application process "Safari" at {683, 378}
--> missing value
click missing value
click application process "Safari" at {515, 489}
--> missing value
click missing value
click application process "Safari" at {665, 417}
--> missing value
click missing value
Result:
error "User canceled." number -128
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Works fine here, have you enabled "Enable access for assistive devices" in System Preferences>Universal Access ?
Also there are some items in webpages that somehow mess up automated clicking and stops it from working, be it Applescript or Automators "watch me do" action
 
Joined
Dec 14, 2010
Messages
4
Reaction score
0
Points
1
Hi i know this is oldish but i have written a similar script except using runescape. I can get up until logging in but once I hit "play" it says missing value. same with minecraft. Everything up until I hit singleplayer. These buttons are both ingame. I have "Enable access for assistve decices" turned on.. any help?
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Yeah, both Runescape and Minecraft use java, and Applescript doesn't seem to have been made compatible with Java at all.
I'm afraid that your pretty much at a dead end here, since there are plenty of people out there with the same problem and no fix.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top