Generate Mouse Event with applescript

Discussion in 'Mac Programming' started by mason.kramer, May 6, 2008.

  1. mason.kramer macrumors 6502

    mason.kramer

    Joined:
    Apr 16, 2007
    Location:
    Watertown, MA
    #1
    Hi. I'm playing a computer game that allows me to advance in a certain way if I could only repeatedly click a mouse button once per second for hours on end. For reasons unknown to me, I actually want to do this. I don't know much about applescript, but I from what I understand about applescript, this is the kind of thing that applescript is actually good at. Can anyone give me a script that, when run, will just click my mouse repeatedly, whereever the cursor happens to be placed? Or perhaps direct me to some documentation about applescript and mice?
     
  2. MongoTheGeek macrumors 68040

    MongoTheGeek

    Joined:
    Sep 13, 2003
    Location:
    Its not so much where you are as when you are.
    #2
    tell application "System Events"
    tell process "World Of Warcrack"
    click at {10, 10}
    end tell
    end tell

    coordinates are x,y in quadrant 3 (i.e. 0,0 is top left)
     

Share This Page