Automator auto click

Joined
Aug 21, 2010
Messages
5
Reaction score
0
Points
1
Hello all, I am new to these forums, and this is my first post.

How do I use Automator on a Mac to click continuously? I just want the mouse to click at like 10 second intervals continuously. I found out it can be done on Automator, but I don't know how. Please help.

This is for gaming purposes, i just need a click every few seconds to not go idle.
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Hello, Welcome to M-F :)

Try the attached Automator Script, it's not the best auto clicker but its the best Automator can do.
You can't have it loop forever, just certain number of times or minutes, once started it is almost impossible to stop it, and the mouse always goes to the same spot on the screen to click.

View attachment Autoclicker.zip
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,609
Reaction score
1,076
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Ventura, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
Didn't know you were an Automator genius McYukon. Next time I back myself into a corner I will know who to call. I still haven't put in the time top master looping and variables.
 
OP
G
Joined
Aug 21, 2010
Messages
5
Reaction score
0
Points
1
Hello, Welcome to M-F :)

Try the attached Automator Script, it's not the best auto clicker but its the best Automator can do.
You can't have it loop forever, just certain number of times or minutes, once started it is almost impossible to stop it, and the mouse always goes to the same spot on the screen to click.

Where it says 'Watch Me Do' should i click record at top and record the action I want? I did that and I get an error.
I am trying to get a continuous click in a third-party application. It uses java. does that affect it? The clicker works when I am in Safari and clicking stuff, and it repeats then, using the above process, but it wont work in the java game.

Am I doing something wrong? Help please! But thanks for the prompt response, within a day.
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,609
Reaction score
1,076
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Ventura, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
Just have a few questions that might help us solve this issue.

1. Which OS are you running? The versions of Automator behave slightly differently. Some of the functions can be a bit "twitchy" at times.
2. Do you remember the error message that you get? Normally you would do as you said click record and record the desired actions.
3. Which game(s) do you need this to function in? That may not matter but you can never have too much information.
 
OP
G
Joined
Aug 21, 2010
Messages
5
Reaction score
0
Points
1
It's a Macbook. Running OS X Snow Leopard. Version 10.6.4 Automator Version 2.1

2. "The action "Watch Me Do" encountered an error. Check the action's properties and try running the workflow again

3. The game is called Puzzle Pirates, if that helps :) Childish, but fun.
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Your right it doesn't seem to work in a Java applet.
It keeps spitting out the same error you get when I click in the java applet, anywhere else and it works without a problem.

Try tricking it. Since clicking directly on the Java won't work,
Remember the position you want to click in, then open another empty Safari window.
Start recording and click in the right spot in the empty window.
Stop recording and close the empty window, then run the recorded action in the window with the game in it.
It should be able to click, I don't know if the Java registers the click but this way it doesn't throw an error.
 
OP
G
Joined
Aug 21, 2010
Messages
5
Reaction score
0
Points
1
Gah!! it Gave the same error! Darn you Java!! :(

Any more ideas?, you have been a help, i can now loop stuff, so I have learned from this experience.
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Well it seems automator doesn't like clicking on Java at all.
You are using Safari to play the game right? Now it's time to try it with applescript!

Open the AppleScript Editor in the Utilities folder and paste in this code.
Code:
repeat 10 times
	delay 1
	tell application "System Events"
		tell application process "Safari"
			click (click at {650, 730})
		end tell
	end tell
end repeat

You can change the number of times it runs (repeat 10 times)
Leave the delay at 1, I don't know if the System can handle 100 clicks/second

Then use the screenshot tool to find the coordinates (command+shift+4), and replace the 650 and 730 with the coordinates you want to click on. The screenshot tool's top coordinate is the first number and the bottom the last number. (Careful that you don't accidentally remove the , )

Press the compile button, if everything goes right everything will get colorized in the script.
Save it as an Application, open it and test it. When the script is running you cannot quit the AppleScript Application the normal way, you will have to force quit it.
 
OP
G
Joined
Aug 21, 2010
Messages
5
Reaction score
0
Points
1
Puzzle Pirates is a pop-out little applet thingy(didn't work, I give up :/), but I see another purpose that i can use this for. Can you make it for 3 clicks, with the same coordinate thingy?

Also Automator Virtual Input (its a program) gives you the cordinates easily :)
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
You want it with 3 clicks in different places?
Sure,

Code:
repeat 1 times
delay 2
tell application "System Events"
tell application process "Safari"
delay 2
click (click at {290, 335})
delay 2
click (click at {240, 380})
delay 2
click (click at {220, 430})
end tell
end tell
end repeat
Don't know why it isn't stepped, but when you Compile it, it will be put right.
You can remove or change the delay functions in the Safari block if you want it just may not click right without them.
 
Joined
Dec 19, 2010
Messages
1
Reaction score
0
Points
1
Well it seems automator doesn't like clicking on Java at all.
You are using Safari to play the game right? Now it's time to try it with applescript!

Open the AppleScript Editor in the Utilities folder and paste in this code.
Code:
repeat 10 times
	delay 1
	tell application "System Events"
		tell application process "Safari"
			click (click at {650, 730})
		end tell
	end tell
end repeat

You can change the number of times it runs (repeat 10 times)
Leave the delay at 1, I don't know if the System can handle 100 clicks/second

Then use the screenshot tool to find the coordinates (command+shift+4), and replace the 650 and 730 with the coordinates you want to click on. The screenshot tool's top coordinate is the first number and the bottom the last number. (Careful that you don't accidentally remove the , )

Press the compile button, if everything goes right everything will get colorized in the script.
Save it as an Application, open it and test it. When the script is running you cannot quit the AppleScript Application the normal way, you will have to force quit it.

I did everything you said to do, but I got this error when I ran the application.
Here is what error I got: Image - TinyPic - Free Image Hosting, Photo Sharing & Video Hosting
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
What OS are you using? And is the "Enable access for assistive devices" enabled in System Preferences>Universal Access ?
 
Joined
May 15, 2011
Messages
1
Reaction score
0
Points
1
hey there, I have a simillar issue, mind if I but in?

I found this thread yesterday, I've been trying unsuccessfully for a while now to make some kind of work-flow for Automator or apple script to continuously flip the pages of a swf player and print each page to pdf. I tried using the aforementioned script and while in the events log on apple-script editor it says it's working, nothing happens. Any suggestions McYukon?
btw I'm running Mac OS 10.6.4.
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
I'll quote what I said to an earlier question like this.
I have tried Applescript with Java and Flash and both times I draw a blank.
I can see Applescipt try to click, the Browser responds with the page title and page contents and then fails to send the Flash/Java content to Applescript telling it that it's there.
I strongly believe that it's just Flash that needs to be made to receive Applescript commands so that it knows what to do with them.

Annoying, but there isn't much one can do about it except maybe complain to Adobe, although I doubt they care about it much.
 
Joined
Jan 4, 2012
Messages
1
Reaction score
0
Points
1
I know the answer to this

Hey man, I've got the absolute solution for your autocicker, mind you that this clicks every second interval you choose, must be whole numbers though =[ Anyways, pre-downloaded into your Mac is a program called "applescript" When you type in this code displayed here:
on idle
tell application "System Events"
key code 87
end tell
return 1
end idle
This code means that it will take over your mouse clicker and click at 1 second intervals, to change the speed of the interval change the "return 1" to "return (number here)"
There are some other things which you have to keep in mind though, go into your settings > universal access and turn mousekeys on, this stops you from typing, and secondly while in the same menu check the box which states "Allow assistive devices....etc" once done, save the applescript file as application format, name it whatever you want & check the box "stay open"

Now search in finder for your specified application name, place the mouse in the area where you wish it to click and you're off! A free, virus-safe, pre-downlaoded autoclicker in your computer! Have fun and ask me anything else I'LL ANSWER. I am actually A representative for Mac so I know alot about the technology, if this doesn't work I'll test it myself again and see what I left out, -King
 
Joined
May 8, 2012
Messages
1
Reaction score
0
Points
1
Still not working

Okay, im also new to automator and i found this this thread. I downloaded the autoclicker workflow McYukon attached. After opening it, i pressed record as you guys have mentioned and i clicked a button on Safari. Thats just what i want automator to do. So when i click run, nothing happens. The mouse moves to the middle of the screen and thats it. It wont click anything...
 
Joined
Jan 19, 2014
Messages
1
Reaction score
0
Points
1
Hey man, I've got the absolute solution for your autocicker, mind you that this clicks every second interval you choose, must be whole numbers though =[ Anyways, pre-downloaded into your Mac is a program called "applescript" When you type in this code displayed here:
This code means that it will take over your mouse clicker and click at 1 second intervals, to change the speed of the interval change the "return 1" to "return (number here)"
There are some other things which you have to keep in mind though, go into your settings > universal access and turn mousekeys on, this stops you from typing, and secondly while in the same menu check the box which states "Allow assistive devices....etc" once done, save the applescript file as application format, name it whatever you want & check the box "stay open"

Now search in finder for your specified application name, place the mouse in the area where you wish it to click and you're off! A free, virus-safe, pre-downlaoded autoclicker in your computer! Have fun and ask me anything else I'LL ANSWER. I am actually A representative for Mac so I know alot about the technology, if this doesn't work I'll test it myself again and see what I left out, -King


I messed up and didn't turn mouse keys on, how can I quit the application?
 
Joined
Nov 22, 2017
Messages
1
Reaction score
0
Points
1
Need a bit more help please.

Hello.

Ive been trying a few of these out. Some I can make work. Some not so much.

This worked for me but didn't do all i needed. With mousekeys turned on.

on idle
tell application "System Events"
key code 87
end tell
return 2
end idle


What I am wanting is the above script but for 2 different locations on the screen. The first location I want clicked 22 times with a 1 sec delay between them. Then 1 click in a new location on the screen. Then repeat the entire process.

I am wanting this for a game played through Firefox. The top script above works but only in the one location. I have tried to modify it for multiple locations but I'm going wrong somewhere and it never works.

I tried this one but it wouldn't work at all. The error i get when running this one is below the script. I have tried the game in Safari for the below script. But 1, game plays like ****. 2, I cant make the script work in Safari either. Ideally would be above script edited to my requirements as That one works in firefox happily and the game plays well in Firefox.

repeat 10 times
delay 1
tell application "System Events"
tell application process "Safari"
click (click at {650, 730})
end tell
end tell
end repeat

ERROR = error "System Events got an error: Can’t make missing value into type UI element." number -1700 from missing value to UI element

Thanks :)
Dk
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top