Re: Scripting Addition to automate mouse clicks in Mac OS X 3.9
Re: Scripting Addition to automate mouse clicks in Mac OS X 3.9
- Subject: Re: Scripting Addition to automate mouse clicks in Mac OS X 3.9
- From: kai <email@hidden>
- Date: Sat, 4 Feb 2006 18:22:05 +0000
On 3 Feb 2006, at 00:42, Andrew Bush wrote:
I have an application Im trying to automate, and it has some
specific controls that do not seem to respond to the applescript
'click at' command.
does anyone know of a scripting addition that will perform mouse
clicks at a lower level?
there must be *some* way to fake this...after 2 weeks work we're
one problem away from having this stage completed.
Apologies for the late response, Andrew - but there may be something
out there that'll do the trick for you.
It really is a pity that the 'click at' command doesn't yet seem to
work as advertised. I wondered if XTool.osax might just manage the
job, but it doesn't quite cut the mustard in this type of situation -
and I understand that it's not currently supported, either.
However, 'Extra Suites' is a background scripting application that
may do what you want. It's reasonably priced and features over eighty
commands - including move and click mouse, text manipulation,
progress bars and resource fork manipulation. (No, I'm not on
commission.) To try out the application, you can download it from the
MacScripter site:
http://osaxen.com/files/extrasuites1.1.html
From a previous message you posted, I assume that your target app is
Freehand, which I'm not currently using. However, I'll try to
demonstrate the general principle by accessing another UI element
that has proved notoriously elusive in terms of UI access: the PDF
button in a Cocoa app's standard print dialog. You need only
establish the position of the target UI element.
This, for instance, should save the front document of the targeted
app to the desktop as a PDF file:
----------------
to |click mouse| at p
tell application "Extra Suites"
ES move mouse p
ES click mouse
end tell
end |click mouse|
to |save front doc as PDF| to file_name from app_name
tell application "System Events" to tell process app_name
set frontmost to true
keystroke "p" using command down
tell UI element -1 of UI element -1 of UI element -5 of sheet 1 of
window 1
repeat until exists
delay 0.1
end repeat
|click mouse| of me at position
end tell
key code {125, 36}
repeat until window "Save" exists
delay 0.1
end repeat
keystroke file_name
keystroke "ds" using command down (* save to desktop *)
end tell
end |save front doc as PDF|
|save front doc as PDF| to "Save PDF Test.pdf" from "TextEdit" (* or
from "Safari", etc. *)
----------------
The UI structure of a Carbon application may differ somewhat. To do
something similar in AppleWorks, for example, it would be necessary
to change this line...
----------------
tell UI element -1 of UI element -1 of UI element -5 of sheet 1 of
window 1
----------------
... to something like:
----------------
tell UI element -1 of UI element -1 of UI element -5 of window 1
----------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden