I tried (unsuccessfully) to find a mouse move and click solution in Applescript.
My search brought me to this site:
http://www.geekorgy.com/index.php/2010/06/python-mouse-click-and-move-mouse-in-a pple-mac-osx-snow-leopard-10-6-x/
The following python script will move an object from position 60.100 to 60.300
#!/usr/bin/python
import sys
import time
from Quartz.CoreGraphics import * # imports all of the top-level symbols in the module
def mouseEvent(type, posx, posy):
theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
CGEventPost(kCGHIDEventTap, theEvent)
def mousemove(posx,posy):
mouseEvent(kCGEventMouseMoved, posx,posy);
def mouseclickdn(posx,posy):
mouseEvent(kCGEventLeftMouseDown, posx,posy);
def mouseclickup(posx,posy):
mouseEvent(kCGEventLeftMouseUp, posx,posy);
def mousedrag(posx,posy):
mouseEvent(kCGEventLeftMouseDragged, posx,posy);
ourEvent = CGEventCreate(None);
currentpos=CGEventGetLocation(ourEvent); # Save current mouse position
mouseclickdn(60, 100);
mousedrag(60, 300);
mouseclickup(60, 300);
time.sleep(1);
mousemove(int(currentpos.x),int(currentpos.y)); # Restore mouse position
See also:
http://developer.apple.com/mac/library/documentation/Carbon/Reference/QuartzEven tServicesRef/Reference/reference.html
http://developer.apple.com/graphicsimaging/pythonandquartz.html
Tony