Launching Network pane's Proxies tab?
Launching Network pane's Proxies tab?
- Subject: Launching Network pane's Proxies tab?
- From: Karl Moskowski <email@hidden>
- Date: Thu, 11 May 2006 19:02:50 -0400
In our app's preferences window, we have a button that launches
System Preferences, selects the Network pane, and goes to the first
interface's Proxies tab (like the "Change Settings..." button on the
Advanced tab of Safari's prefs). I use the code below to accomplish
this, but it requires turning on the Universal Access setting "Enable
access for assistive devices" (i.e., GUI scripting).
NSString* appleScriptString =
@"tell application \"System Preferences\" \r \
activate \r \
set current pane to pane \"com.apple.preference.network\" \r \
tell application \"System Events\" \r \
tell application process \"System Preferences\" \r \
click button 1 of group 1 of window \"Network\" \r \
click radio button \"Proxies\" of tab group 1 of group 1 of
window \"Network\" \r \
end tell \r \
end tell \r \
end tell";
NSAppleScript *theScript = [[NSAppleScript alloc]
initWithSource:appleScriptString];
[theScript executeAndReturnError:nil];
Is there a better approach that works in all cases? (We're Tiger-
only, if that simplifies things.)
Thanks.
--Karl <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden