Automate mouse clicks in OS X's Terminal #
with Carsten Blüm's cliclick 2.1, which emulates mouse and keyboard events like moving the cursor, clicking, command clicking, and more. Running it in an infinite loop like so:
while : ; do cliclick c:. ; done
came in handy for a game that required a rapid succession of clicks.
A more practical example can be found in the included "Read me.html":
cliclick c:28,11 w:500 m:28,35 w:1000 kd:alt w:1000 c:. ku:alt
- c:28,11 Click at position 28/11 (open the Apple menu)
- w:500 Wait 500 milliseconds
- m:28,35 Move the mouse to 28/35 (the first menu item, i.e.: "About this Mac"
- w:1000 Wait 1000 milliseconds (so you have time to notice that the item is highlighted)
- kd:alt Press the "alt" modifier key
- w:1000 Wait 1000 milliseconds (to give you the time to notice that "About this Mac" changed to "Open System Profiler")
- c:. Click at the current position ("." is the current mouse position, just as in Terminal, "." is the current directory)
- ku:alt Finally: release the "alt" key
UPDATE 1: Keysmith: "Hit record and Keysmith picks up what you're doing with your mouse and keyboard. Type some text, or click on buttons, menus, Dock items, lists, and more. Keysmith is smart enough to understand it all."
UPDATE 2: See also Auto Clicker for macOS ("A simple auto clicker for macOS Big Sur and macOS Monterey") and AutoClicker ("A useful simple tool for automating mouse clicks") for Windows.
/mac | Dec 21, 2012
Subscribe or visit the archives.