MouseTools... perform clicks and other stuff with your mouse

I’ve been working on a new command line tool to do stuff with your mouse. Today I released it so feel free to use it. You can get it here. There are several applescript examples on the linked web page to show how to use it.

It can do the following:

  1. get current mouse coordinates
  2. jump your mouse to given coordinates
  3. move your mouse slowly to the given coordinates so it glides across the screen
  4. perform left-clicks, right-clicks, or left-clicks with modifier keys down at given coordinates

NOTE: all features can be performed using coordinates based on either the lower-left or upper-left part of the screen.

Since I’ve seen several people want to perform mouse clicks or get mouse coordinates I thought people might be interested in this.

This might make it a little easier to call it an applescript.

property mouseToolsPath : missing value
set mouseToolsPath to "/Scripts/MouseTools"

set location to paragraphs of mouseTools("", "", "-location")  -- use the following 3 lines to  get location and set X and Y to var
set locX to item 1 of location
set locY to item 2 of location

mouseTools("100","150","") -- example to move mouse to 100x150y

on mouseTools(x, y, switch)
	if {x, y} is {"", ""} then
		return do shell script (quoted form of (mouseToolsPath) & " " & switch)
	else
		do shell script (quoted form of (mouseToolsPath) & " -x " & x & " -y " & y & " " & switch)
	end if
	
end mouseTools