How can I automate mouse movement in OS X via AppleScript or a shell script?

10,538

I use cliclick All the time. Works great for everything I need it for

Here is a screen shot some of the commands

enter image description here

Share:
10,538

Related videos on Youtube

Elegant.Scripting
Author by

Elegant.Scripting

Updated on September 18, 2022

Comments

  • Elegant.Scripting
    Elegant.Scripting over 1 year

    Just recently I got into an FPS game and I've wanted to challenge myself to make an anti-recoil script for a while.

    An anti-recoil script would essentially move the mouse based on a set of calculations or a fixed pattern.

    So far I've tried moving the mouse via Automator and Keyboard Maestro, but for some reason when the mouse is moved via these programs, everything except the game recognizes it, and so instead of the game's camera view moving, the actual cursor becomes visible overtop the game and moves to a different point on the screen. Essentially the cursor is teleporting from point to point and the game doesn't recognize it.

    I was wondering if there is an alternative way to move the mouse via AppleScript or shell script?

  • Elegant.Scripting
    Elegant.Scripting over 5 years
    I tried Cliclick, it has the same effect of moving only the mouse position and not the viewfinder in the game, and didn't work.
  • guillaume
    guillaume over 4 years
    +1 for working great on a web page canvas !