• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Launching Network pane's Proxies tab?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: creating NSCalendarDate with a specific time zone
  • Next by Date: Newbie OOP style question
  • Previous by thread: Re: Undefined symbols error in deployment build
  • Next by thread: Newbie OOP style question
  • Index(es):
    • Date
    • Thread