Results 1 to 3 of 3
  1. #1

    Member Since
    Jan 27, 2011
    I'm looking for some AppleScript help for my game :)
    I am new to these forums so excuse me for any problems.

    I am trying to learn AppleScript a little bit, so I figured I'd start by working on something that would help me with my gaming. I am running this game on Safari/Firefox if it matters.

    I kind of want something that will click randomly between 1.00000 and 3.00000 seconds (including the decimals).

    I will update you as I figure parts out.

    This should help me learn a bit about AppleScript =)

    My Current Code:
    tell application "Safari" to activate
    repeat 2000 times
    	set a to random number from 1.0 to 3.0
    	delay a
    	tell application "System Events"
    		tell process "Safari"
    			click at {1000, 300}
    		end tell
    	end tell
    end repeat

  2. #2

    Member Since
    Jan 27, 2011
    I was saying that it didn't click in a normal webpage... but it does.

    It says this however when trying to click on my Java Based game:

    tell current application
    random number from 1.0 to 3.0
    --> 1.316124503011
    end tell
    tell application "System Events"
    click process "Safari" at {1000, 200}
    --> missing value
    end tell

  3. #3

    McYukon's Avatar
    Member Since
    May 14, 2009
    Near Whitehorse, Yukon
    2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
    From what I figured out from past Applescripting it will not click on Java apps, in browser or standalone.
    Your code is correct and it will click in a normal webpage as you said, but as soon as it hits a java application something changes and it buggers up.
    I tried both Applescript and Automator and both have the same problem, and I haven't found a solution for it yet.
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help Please! I need Applescript help!
    By jf4m in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 12-02-2011, 09:34 AM
  2. Replies: 0
    Last Post: 07-22-2011, 07:52 PM
  3. Can i do this with Applescript ?
    By xavierpointcom in forum OS X - Operating System
    Replies: 0
    Last Post: 05-19-2011, 06:46 AM
  4. Applescript to load a game + no cd crack
    By fernando87 in forum OS X - Apps and Games
    Replies: 6
    Last Post: 04-07-2009, 12:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts