RE: GUI Scripting and "International" Preferences
RE: GUI Scripting and "International" Preferences
- Subject: RE: GUI Scripting and "International" Preferences
- From: "Kinsella, John R." <email@hidden>
- Date: Mon, 6 Jan 2003 07:43:24 -0600
You're right, GUI scripting allows us to take advantage a far more features
than ever before. But, in order to do so, we have to decrypt the order that
each programmer placed and grouped each of the UI elements in their app,
which is not easy.
I've found so far that a combination of the probe example script, which,
with some simple modifications (basically change the app that it's calling)
will display all of the UI elements that it finds. Then, I pick on of those
(for instance, it may find a tab group or it may find a button or text field
or another group,) and I nest the scanning code of the probe script in
another tell block for that next group. For instance...
(semi correct code here)
tell application "System Preferences"
activate
end tell
tell application "system events"
tell process "system preferences"
tell window 1
--scanning code here from the probe example script
end tell
end tell
end tell
Now, once I run this and get some feedback I'll insert a new tell block, in
this case, for a tab group
(semi correct code here)
tell application "System Preferences"
activate
end tell
tell application "system events"
tell process "system preferences"
tell window 1
tell tab group 1
--scanning code here from the probe example script
end tell
end tell
end tell
end tell
I'll keep doing this until I find the UI element I'm looking for. Once I
find it, I've got the nesting order I need to make changes to that UI
element for my actual script.
Now, this isn't foolproof, so in conjunction I'll also, for each element,
run the get every UI element command. This will display just about every UI
element for that window or group.
As you can see, as far as my experience goes (and maybe someone has come up
with a better way) this is not the easiest thing to do, but it's worked so
far for me, and allowed me to call just about anything, including sheets.
Hope that's helpful! If I get some time, I'll see if I can figure out the
International preferences order for you.
Thanks!
John Kinsella
IRT-CS
University of St. Thomas
-------------
"The surest way to corrupt a youth is to teach him to hold in higher regard
those who think alike rather than those who think differently."
--Nietzsche
--__--__--
Message: 1
Date: Sun, 05 Jan 2003 23:28:13 -0500
Subject: GUI Scripting and "International" Preferences
From: jason bergman <email@hidden>
To: <email@hidden>
I'm playing around with the new GUI scripting functions in the 2.0
beta...it's all very cool, and hopefully it'll allow me to write a script
I've always wanted -- the ability to turn the character palette on and off
at will.
Here's the problem: I can get it to launch system preferences, and switch to
the "international" window by way of the "view" menu and switch to the
"Input Menu" tab...the problem is, I can't identify the check box that's
second from the top to turn on the character palette.
Can anyone help? Is there any easy way to identify this check box? I've
tried "tell group 1 click check box 2" but I just get an error.
Thanks in advance,
-jason
--__--__--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.