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 > GUI scripting in Applescript

GUI scripting in Applescript
Thread Tools
Ratatoskur
Fresh-Faced Recruit
Join Date: Sep 2002
Status: Offline
Reply With Quote
May 5, 2003, 12:17 PM
 
Hi

I am trying to make a script that can open up System Preferences, select International, select Input menu and then change the keyboard layouts by clicking to select and deselect.

I've managed to get to Input menu but no matter what I try I still cannot find out how to click on the checkboxes there.

it should be something like this, shouldn't it :
click checkbox 1 of row 1 of table 1 of scroll area 1 of tabgroup 1 of window "International"

But nothing happens. Any ideas ?

I am using UI browser.

By the way, is it perhaps possible to achieve what I am trying to do without GUI Scripting ?

------
tell application "System Preferences"
activate
end tell

tell application "System Events"
tell process "System Preferences"
click button "International" of scroll area 1 of window "System Preferences"
delay 1
tell window "International"
tell tab group 1
click radio button "Input Menu"
delay 1



end tell
end tell
end tell
end tell
-------
     
gatorparrots
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status: Offline
Reply With Quote
May 6, 2003, 12:46 PM
 
GUI scripting is currently in beta. I think you are encountering a bug that is currently insurmountable. Others on another forum are attempting to accomplish a similar feat with the International pref pane and are running into similar problems:
http://forums.osxfaq.com/viewtopic.php?t=5459

The only recourse would be to create two plist files, each with the appropriate keyboard layout. Copy them into place and relaunch the Finder. You can accomplish this via an AppleScript or shell script.
     
Ratatoskur  (op)
Fresh-Faced Recruit
Join Date: Sep 2002
Status: Offline
Reply With Quote
May 6, 2003, 01:45 PM
 
Yes, I see. It seems to be a bug.




"The only recourse would be to create two plist files, each with the appropriate keyboard layout. Copy them into place and relaunch the Finder. You can accomplish this via an AppleScript or shell script."

Hmm...yes, I could try that.
But where is the plist- file for the International prefpane ?
     
cpac
Professional Poster
Join Date: Jul 2001
Location: New York, NY
Status: Offline
Reply With Quote
May 6, 2003, 05:54 PM
 
I'm guessing there's some reason using the keyboard layout menu (that appears when you have more than one input keyboard selected) doesn't work for what you need to do?

(if it did, that might be another way to get around the bug you're running into)
cpac
     
   
 
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
Top
Privacy Policy
All times are GMT -4. The time now is 01:29 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,