• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Move cursor with Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Move cursor with Applescript


  • Subject: Re: Move cursor with Applescript
  • From: Robert Poland <email@hidden>
  • Date: Sat, 3 Apr 2010 14:28:17 -0600

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

  • Follow-Ups:
    • Re: Move cursor with Applescript
      • From: Yvan KOENIG <email@hidden>
References: 
 >Re: Move cursor with Applescript (From: Craig Williams <email@hidden>)

  • Prev by Date: Re: Move cursor with Applescript
  • Next by Date: Re: Move cursor with Applescript
  • Previous by thread: Re: Move cursor with Applescript
  • Next by thread: Re: Move cursor with Applescript
  • Index(es):
    • Date
    • Thread