New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Ľ Advice and insight from world-class Apple enthusiasts Ľ Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

applescript


Post Reply New Thread Subscribe

 
Thread Tools
Lex

 
Member Since: Nov 26, 2009
Posts: 64
Lex is an unknown at this point

Lex is offline
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
QUOTE Thanks
Lex

 
Member Since: Nov 26, 2009
Posts: 64
Lex is an unknown at this point

Lex is offline
added: text scpt (mac-forums doesn't allow me to add the actual script)
Attached Files
File Type: txt BOT.txt (338 Bytes, 12 views)
QUOTE Thanks
Lex

 
Member Since: Nov 26, 2009
Posts: 64
Lex is an unknown at this point

Lex is offline
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
QUOTE Thanks
McYukon

 
McYukon's Avatar
 
Member Since: May 14, 2009
Location: Near Whitehorse, Yukon
Posts: 2,053
McYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to behold
Mac Specs: 2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9

McYukon is offline
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

Use the reputation system if a post helps you!
Mac Forums IRC Channel - Help build it by hanging out with us
The next sentence is true. The previous sentence is false.
QUOTE Thanks
Echelon

 
Member Since: Dec 14, 2010
Posts: 4
Echelon is on a distinguished road

Echelon is offline
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?
QUOTE Thanks
McYukon

 
McYukon's Avatar
 
Member Since: May 14, 2009
Location: Near Whitehorse, Yukon
Posts: 2,053
McYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to behold
Mac Specs: 2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9

McYukon is offline
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.

Use the reputation system if a post helps you!
Mac Forums IRC Channel - Help build it by hanging out with us
The next sentence is true. The previous sentence is false.
QUOTE Thanks

Post Reply New Thread Subscribe


« How to know which entourage database file is in use | "vacation"-message only works when @me address is used, while most people use my @mac »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
help needed to link up buttons on HUD Window to Applescript nick_harambee OS X - Development and Darwin 0 09-30-2010 09:26 AM
newbie question on XCode 3.2: how to populate pop up buttons/link to applescript nickharambee OS X - Operating System 0 10-21-2009 08:10 AM
Logic Express and Applescript via GUI Scripting albertaurus Music, Audio, and Podcasting 0 04-09-2009 02:13 PM
Applescript for Toggling Energy Saver Presets Unifier OS X - Operating System 1 03-17-2008 09:58 PM
[ANN] New comprehensive AppleScript book hanaan OS X - Development and Darwin 0 11-06-2004 08:28 PM

All times are GMT -4. The time now is 12:51 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?