Click mouse every 60 secs. for 3 hrs

Hello!

First post, first attempt at building a simple script. My goal is simply to execute a left-mouse click every 60 seconds for 3 hours once triggered. There may be more efficient ways to do what I have done so I'm open to suggestions.

I've done my best to review many other postings to help educate me on how to use this tool as I built this macro.

Can someone review what I have done here and tell me where I might be more efficient or if this will even work as intended? I don't quite understand the "until" portion where "all of the following are true" where it says "Add Condition". I do not think I need anything there since it will execute once and then go back into the "Repeat Actions" loop. Is that correct?

das ist ein Test

Sorry, don't understand how your reply that "This is a test" in German answers the question. If you are asking if I tested? Yes. It appear to work.

Ideally, I would like to have a way to know how many of those 180 times the macro executed if I were to stop it but that's the next bit of my experimenting.

1 Like

Hello @Macro-newbie, please excuse my oversight. I had tested something with a macro palette before and accidentally sent the text.

You can be more efficient by getting rid of the superfluous Execute Actions Until action, like this:

Obviously you need to change the Move action to suit your own purposes.

1 Like

Ah...excellent point. Was overthinking it for sure. Thank you for the pointer.

1 Like

You’re welcome. One other thing: do you really want to tie up your Mac for 3 hours because every 60 seconds KM is going to try to take control of your mouse? If you are trying to use your Mac at the same time the macro may not be able to click in the right place and equally the macro might spoil what you’re trying to do - every 60 secs for 3 hours!!

Fair point....I'm going to have this run on a secondary Mac as a simple keep alive for a couple days while I watch activities happening in a remote access/session window which has a session terminator for no activity which I cannot control.

Longer term, I really like the things I see in the tool here and as I tinker I am thinking through other things I want to automate that are more complex. Part of the issue is getting my head not to overthink things as you pointed out I did here. The Automator tool with MacOS isn't nearly as flexible as what I have found here.

1 Like

Assuming you can't use amphetamine on the remote device: I would suggest moving the mouse by 1 pixel as infrequently as possible. That way you're less likely to mess anything up

1 Like

You should also deal with whatever issue Keyboard Maestro is complaining about:

image

Also, as noted, you should see if you can get away with just moving the mouse, in which case, perhaps:

  • Repeat 90 times
    • Move Mouse right 5 pixels
    • Pause 60 seconds
    • Move Mouse left 5 pixels
    • Pause 60 seconds

Thanks @peternlewis... I needed to move the application from Downloads folder to Applications folder.

Alas, a simple move of the mouse does not work in my testing.

1 Like

Please excuse @Macro-newbie my English is not so good (online translator), do I understand you correctly that your only concern is to keep your Mac awake and prevent it from retiring with the mouse clicks?