0

I'm trying to find a way to emulate a single mouse-click and I want this action to be performed specifically at a certain time everyday (For example: 6am).

It is a requirement related to my work as I won't always be available at that point in time to personally perform the mouse click.

In an ideal world, I would want to create a workflow where my web browser is automatically opened and the mouse is moved and clicked in such a way that I finally click on the function I want.

But I realize that would be overly complex, so I'm willing to do some prep beforehand and position the mouse cursor directly over the desired option so that all that would need to be done is to perform the "click".

is automation like this possible on macOS?

3
  • This sound like making a http GET request. The best way to do this is find out what the web server does on that click and see what its API shows and run a command line using curl to make the GET request.
    – mmmmmm
    Commented Feb 3 at 11:23
  • Googling for "how do I simulate a click with AppleScript" and "how do I schedule an AppleScript" yields many answers. Did you try that?
    – benwiggy
    Commented Feb 3 at 17:41
  • Thanks for the answer. As mentioned, I'm not too tech savvy, so where exactly do I need to look to find out what the web API does on the click (Google developer console?) and could you give me some pointers as to how I begin writing a "curl" code in mac command line to emulate the API? Commented Feb 5 at 6:31

1 Answer 1

2

It is possible to use AppleScript to trigger a click at a given location.

How do I make the mouse click at current location using AppleScript?

You'd then have to schedule the task. Applescript run code at specific time

There are several third-party software tools that will make it easier to perform webpage manipulations as well as simulate clicks if you don’t need AppleScript native functions for easy app activation and launching.

... Are you pretending that you're at your desk? ;-)

4
  • 2
    It‘s extremely simple in Keyboard Maestro, would also open the web page and position the cursor.
    – nohillside
    Commented Feb 3 at 12:17
  • Many thanks for the answer! I'll try this out. Commented Feb 5 at 6:32
  • As for Keyboard Maestro, I've taken a look at it and it is unfortunately a paid piece of software. You mentioned that, "There are several third-party software tools that will make it easier to perform webpage manipulations as well as simulate clicks if you don’t need AppleScript native functions for easy app activation and launching". Could you point me to these applications? (they should preferably be free) Commented Feb 5 at 6:34
  • 1
    @AnshuChang You can either spend $36 on Keyboard Maestro, or spend your time learning how to write the script yourself.
    – benwiggy
    Commented Feb 5 at 7:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .