Smiles2212

Q: How do you make an applescript mouse clicker?

I need an applescript script that can click on certain points over and over again. I'm sorry, but i'm a complete noob at any scripting, so you migt have to hold my hand and walk me through it.

MacBook Pro

Posted on Feb 3, 2012 6:29 PM

Close

Q: How do you make an applescript mouse clicker?

  • All replies
  • Helpful answers

Previous Page 2
  • by Roote,

    Roote Roote Jun 11, 2015 4:44 PM in response to Max Curious
    Level 2 (417 points)
    Jun 11, 2015 4:44 PM in response to Max Curious

    If you download Carsten Blüm's Cliclick @ https://www.bluem.net/en/mac/cliclick/ and install it into /usr/local/bin you can run this command in Script Editor to left click the current position of the mouse cursor:

    do shell script "usr/local/bin/cliclick c:."

     

    The "c" is the command identifier for clicking, the "." or period is the command argument, and the ":" or colon separates the two. The following command is equivalent and uses relative zero values instead:

    do shell script "usr/local/bin/cliclick c:+0,+0"

     

    Since Cliclick is a command-line tool, you can use this command in Terminal to do the same thing:

    cliclick c:+0,+0

     

    Another tool you can use is PyMouse, now a part of PyUserInput. You can download it from GitHub @ https://github.com/SavinaRoja/PyUserInput. Install instructions @ https://github.com/SavinaRoja/PyUserInput/wiki/Installation. To use in Script Editor, you can use this command to left click the current position of the mouse cursor:

    do shell script "

    /usr/bin/python <<END

    from pymouse import PyMouse

    m = PyMouse()

    pos = m.position()

    m.click(pos[0], pos[1])

    END"

  • by richardfromcascais weymouth,

    richardfromcascais weymouth richardfromcascais weymouth Sep 13, 2015 8:19 AM in response to Roote
    Level 1 (0 points)
    Sep 13, 2015 8:19 AM in response to Roote

    This is easy to implement and understand

     

    on ChromeButtonsEasy(TheTargetURL, TheTargetButtonId)

    (*below to be duplicated and placed before "my ChromeButtonsEasy(TheTargetURL, TheTargetButtonId)"*)

    (*set TheTargetURL to "Blank_1"

      set TheTargetButtonId to "Blank_2"*)

     

    (* Replace Blank_1 with url of your target page by copeying the address bar

      Replace Blank_2 by using right click in chrome on the button and copying snippett after id *)

      tell application "Google Chrome"

      if not (exists window 1) then reopen

      activate

      tell window 1 to tell active tab

      set its URL to TheTargetURL

      delay 3

      execute javascript "document.getElementById(" & quoted form of TheTargetButtonId & ").childNodes[0].click()" --find the id by using inspect element

      end tell

      end tell

    end ChromeButtonsEasy

  • by thankgodforapple,

    thankgodforapple thankgodforapple Aug 17, 2016 7:33 PM in response to Max Curious
    Level 1 (4 points)
    Aug 17, 2016 7:33 PM in response to Max Curious

    Hello - Did you ever figure this out? I'm trying to do something similar, without much luck....

  • by thankgodforapple,

    thankgodforapple thankgodforapple Aug 17, 2016 7:55 PM in response to red_menace
    Level 1 (4 points)
    Aug 17, 2016 7:55 PM in response to red_menace

    Hello - hoping you can help. I'm using this Applescript in an attempt to click at a specific coordinate in FileMaker Pro, but very little experience here and it's not working. It will bring up the application, but not click at the coordinates. Any suggestions? I'm using FM 9 and El Capitan OS.

     

    tell application "System Events"

      tell process "FileMaker Pro"

      click at {308, 355}

      end tell

    end tell

     

     

    Thank you.

Previous Page 2