Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Move cursor with Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Move cursor with Applescript



Thanks Craig,

Looks like the way to go.

However the instructions for installing Cliclick are over my head.

"Put cliclick anywhere you like. The best (i.e.: most common) place would probably be
/usr/local/bin"

I tried the Application folder and the Universal Scripts folder.

I also tried looking for /usr/local/bin with sherlock, etc.

I tried iShow Invisible but that gave me too many options.

Any other suggestions?


On Apr 3, 2010, at 12:53 PM, Craig Williams wrote:

I'm trying to change an iKey function to a script.

(*
ClickZoomBox - 4/3/10    
*)
tell application "System Events"
 Move cursor to 57,12 (T/L)
click -- click left mouse button
end tell


Moving the mouse and clicking can be achieved using cliclick -> http://www.bluem.net/en/mac/cliclick/
ex.
do shell script "cliclick 51 17"


If you only want to move the mouse and not perform a click then you can use CGWarpMouseCursorPosition(). 

Here is an example using MacRuby but you could easily turn this into a command line utility.
set x to 57
set y to 12
do shell script "/usr/local/bin/macruby -e \"framework 'carbon'\" -e \"framework 'ApplicationServices'\" -e \"CGWarpMouseCursorPosition(CGPointMake(" & x & "," & y & "))\""

Regards,

Craig

Robert Poland - Fort Collins, CO



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Move cursor with Applescript (From: Craig Williams <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.