Questions

Auto clicker script for Mac

Download on the Mac App StoreInputConfig is completely free on the Mac App Store. You don't have to make an account, there are no subscriptions, and nothing is locked. Optimized for Apple silicon.

AppleScript can click a button it can name, but not any spot on the screen. For clicks at a point from Terminal, the free cliclick tool does it in one line. If you only want clicks on a timer with no code, InputConfig, free on the Mac App Store, does it from a key or a button.

On this page
  1. Steps
  2. Know what AppleScript can click
  3. Click from Terminal with cliclick
  4. Use the cliclick cheat sheet
  5. Decide when a script beats an app
  6. Skip the script
  7. The short version
  8. Questions

Steps

  1. Install cliclick with Homebrew: brew install cliclick.
  2. Allow Terminal in System Settings, Privacy & Security, Accessibility.
  3. Run cliclick c:. to click where the pointer is.
  4. Put it in a loop with a sleep to click on a timer.
  5. Press Control C to stop the loop.

Know what AppleScript can click

AppleScript talks to apps through System Events, which can click a button or a menu item by its name. It has no plain way to click a point on the screen. For a button with a name, AppleScript works. For a spot on the screen, use cliclick.

Click from Terminal with cliclick

cliclick is a free, open-source command-line tool by Carsten Blüm that clicks, moves the pointer and types from Terminal.

Terminal: Install it.

brew install cliclick

What happens: Homebrew installs it, and cliclick -h lists every command.

Terminal: Click at x 500, y 300.

cliclick c:500,300

What happens: One click lands at that point. A dot instead of numbers clicks where the pointer is.

Terminal: Click where the pointer is, ten times a second, until you press Control C.

while true; do cliclick c:.; sleep 0.1; done

What happens: Clicks repeat until you press Control C in that Terminal window.

Terminal needs Accessibility access for the clicks to land, in System Settings, Privacy & Security, Accessibility.

Use the cliclick cheat sheet

These commands are from the cliclick README, which I read on October 27, 2026. Coordinates are x,y. A + or - in front of a number moves relative to the pointer, and a dot means where the pointer is now. Terminal needs Accessibility access first.

CommandWhat it doesExample
c:x,yClickcliclick c:500,300
dc:x,yDouble clickcliclick dc:500,300
tc:x,yTriple clickcliclick tc:500,300
rc:x,yRight clickcliclick rc:500,300
m:x,yMove the pointercliclick m:+50,+0
dd:, dm:, du:Drag: press down, move, then releasecliclick dd:100,100 dm:200,200 du:300,300
t:textType text into the front app, in quotes if it has spacescliclick t:"Hello there"
kp:keyPress and release a key such as return or esccliclick kp:return
kd: and ku:Hold and release modifier keys (alt, cmd, ctrl, fn, shift)cliclick kd:cmd,alt
w:msWait, in millisecondscliclick w:500
p:.Print the pointer positioncliclick p:.

One call takes any number of commands, run in order, so a click at one spot, a wait and a click at another spot is one line.

Terminal: Click two spots a second apart, then put the pointer back where it was.

cliclick -r c:500,300 w:1000 c:700,300

What happens: The -r option restores the pointer to where it started when the commands finish.

Several spots in order is the one thing a script does that a single InputConfig row does not.

Decide when a script beats an app

  • A script wins for several spots. One cliclick call can visit as many points as you list, while each InputConfig row clicks one spot.
  • A script wins inside bigger scripts. A shell script can run cliclick as one step among others.
  • An app wins for starting and stopping. A hotkey or a controller button starts it, the gap is a number in milliseconds, and the emergency stop ends it from any app.

Skip the script

A loop in Terminal stops only from that window. In InputConfig, the built-in Auto Clicker preset starts and stops with fn F6, the gap is set in milliseconds, and the emergency stop, Control Option Command period, ends it from anywhere. The free auto clicker for Mac has the setup.

A row in InputConfig's editor with its Options open: a click row set to click at a fixed point, 640, 400, repeating every 1,000 ms.
Figure 1. What the script would do, without the script: click at 640, 400 once a second until you press the button again.

The short version

  • A named button. AppleScript and System Events.
  • A spot on screen. cliclick c: with the coordinates.
  • Clicks on a timer, no code. InputConfig's Auto Clicker preset.

Questions

Can AppleScript click the mouse at a point?

Not in a plain way. AppleScript clicks buttons and menu items by name through System Events. For a point on the screen, use cliclick.

How do I auto click from Terminal on a Mac?

Install cliclick with brew install cliclick, allow Terminal in Accessibility, and run cliclick c:. in a loop with a short sleep.

What commands does cliclick have?

The README lists click (c:), double click (dc:), triple click (tc:), right click (rc:), move (m:), drag (dd:, dm:, du:), type (t:), key press (kp:), modifier down and up (kd:, ku:), wait (w:), print position (p:) and the color at a point (cp:).

This page in other languages: 日本語, Türkçe, 简体中文

Download on the Mac App StoreOpen source on GitHub.

Updated