Move mouse point to specific location

Hi All,

I’m trying to move the mouse pointer to a certain location on the screen:

https://macscripter.net/viewtopic.php?id=12445

  • talked about Extra Suites to move the mouse pointer but that app is not supported on current macOS.

I’m aware of click a mouse on certain location I’m trying to move it

Does anyone have another way?

Mark FX provided code that will do that in post 7 of the thread linked below. I’ve been using Mark’s suggestion in a script and it works well.

https://macscripter.net/viewtopic.php?id=48762

The code is:

use framework "Foundation"
use framework "CoreGraphics"
use scripting additions -- necessary if script contains additional AppleScript code

set cursorPoint to current application's NSMakePoint(500, 500)

set theError to current application's CGWarpMouseCursorPosition(cursorPoint)

if theError = 0 then
   return "SUCCESS"
else if theError = 1 then
   return "FAILURE"
end if

thank you for this! I wasn’t aware that you could do this with just the built-in functionality.