Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > How to move Mouse Cursor with applescript

How to move Mouse Cursor with applescript
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2009
Status: Offline
Reply With Quote
Jan 31, 2011, 12:56 AM
 
Hi
I have this little script that plays two different movies on two different screens in full screen mode.
and it works perfectly when running from script or even when saving as application.
--script
tell application "QuickTime Player"
activate
open alias "Macintosh HD:TestAppleScript:movies:Timer.mov"
play front document
set bounds of front window to {2460, 256, 3299, 768}
present document 1
open alias "Macintosh HD:TestAppleScript:movies:Main.mov"
set bounds of front window to {2460, 256, 3299, 736}
present document 1
play front document
end tell

Here is my problem, I need this application to run automatically when computer starts, so I placed it in to:
Settings -> Accounts -> login items.
So when computer starts it lunches the application and two movies start playing as they should.
The only problem is the default position of mouse cursor (on startup) is in the left upper corner.
What it does - it activates QuickTime Player toolbar and the toolbar doesn't disappears until you actually move the mouse out of this area.

I tried to use the script below to move the mouse cursor, but it only simulates the mouse movement and mouse click and dose not actually moves the cursor on the screen.
--script
activate application "Finder"
tell application "System Events"
tell process "Finder"
click at {271, 15}
--click at {272, 70}
end tell
end tell

Will be glad to try any reasonable suggestions to solve that.
Thanks
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 31, 2011, 02:00 AM
 
This can be done easily enough in C, although there doesn't appear to be any obvious way to do it in AppleScript.

I found an OSAX which claims to be able to do this here, although I have not tried or tested it and thus can not vouch for it.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Professional Poster
Join Date: Jun 2001
Location: Northwest Ohio
Status: Offline
Reply With Quote
Jan 31, 2011, 09:04 AM
 
Originally Posted by CharlesS View Post
I found an OSAX which claims to be able to do this here, although I have not tried or tested it and thus can not vouch for it.
Last updated in February 2003, according to that site. Will Intel Mac OS X even load PPC OSAXen? For that matter, would the above mentioned OSAX even run on 10.5 under PPC?
     
Al2009  (op)
Fresh-Faced Recruit
Join Date: Aug 2009
Status: Offline
Reply With Quote
Jan 31, 2011, 11:20 AM
 
Hi CharlesS, I have tried to download that software and even paid for it $10. But i cant get anything. The file that downloads it is "extrasuites.sit" and I don't know what to do whith it. Didn't get ane help from software distribution company.
Do you have any idea how it works?
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 31, 2011, 11:51 AM
 
Originally Posted by Person Man View Post
Last updated in February 2003, according to that site. Will Intel Mac OS X even load PPC OSAXen? For that matter, would the above mentioned OSAX even run on 10.5 under PPC?
Crap, didn't notice that detail. Sorry about that. Just tried downloading it though, and it does work on my MBP, probably because it's not actually an OSAX at all but rather just a faceless scriptable application à la System Events which runs in Rosetta, and will probably continue to do so until whatever time Apple decides not to care about backward compatibility again and axes Rosetta in some future OS X release (grumble, grumble). The following script seemed to work to move the mouse:

Code:
tell application "Extra Suites" ES move mouse {200, 200} end tell
To answer Al2009's question, it's a StuffIt archive (which was really stupid on the developer's part, since inside the .sit is a standard .dmg archive, and the .dmg format supports compression natively). You'll need either StuffIt Expander or The Unarchiver to open it.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Al2009  (op)
Fresh-Faced Recruit
Join Date: Aug 2009
Status: Offline
Reply With Quote
Feb 1, 2011, 12:36 PM
 
Thanks CharlesS
it works!!!
     
Fresh-Faced Recruit
Join Date: Feb 2011
Status: Offline
Reply With Quote
Feb 28, 2011, 06:40 PM
 
There's a native solution for this issue presented at AndrewParnell.com
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:36 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2