I get the error: "Can’t make {x:651.0, y:675.0} into type real." number -1700 from {x:651.0, y:675.0} to real"" when I run this script. I don't know why this happens! Comes from an autoclicker I made, Very simple, but it works with slightly obscure methods (Credit: Clicker, Mouse Position) . Code:
use framework "Foundation"
use scripting additions
set theList to current application's NSEvent's mouseLocation()
(*
set xCoord to theList's x
set yCoord to theList's y
*)
round (theList)
tell application "System Events"
click at {theList}
end tell
as integer
instead ofround
, e.g.:set xCoord to theList's x as integer
andset yCoord to theList's y as integer
– user3439894 Sep 14 '17 at 20:26