Re: Launching a preference pane from inside a Cocoa app
Re: Launching a preference pane from inside a Cocoa app
- Subject: Re: Launching a preference pane from inside a Cocoa app
- From: Mark Suman <email@hidden>
- Date: Wed, 1 Apr 2009 11:54:05 -0600
The part that's tripping me up is launch System Preferences and then opening
a certain pane. In Apple Script, I'd say:
*tell* application "System Preferences"
activate
*set* *the* current pane *to* pane id "com.foo.prefpane"
*end* *tell*
[[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:
@"com.apple.systempreferences" options:nil additionalEventParamDescriptor
:??? launchIdentifier:nil];
I would like to pass in something like "set the current pane to pane id
\"com.foo.prefpane\" to the event to tell System Preferences to change to my
pane.
Can anyone tell me how to pass that in? I tried through
additionalEventParamDescriptor, but was unsuccessful. It launches System
Preferences, but does not switch to my prefpane. (It works correctly if I
run the Apple Script.)
Mark
On Mon, Mar 30, 2009 at 2:40 PM, Nick Zitzmann <email@hidden> wrote:
>
> On Mar 30, 2009, at 11:17 AM, Mark Suman wrote:
>
> Does anyone know the "Apple" way of launching a prefPane from a Cocoa app?
>>
>
>
> Yes. (If you were wondering _how_ to do it, then all you need to do is open
> the preference pane using NSWorkspace or Launch Services. System Preferences
> will then display the pane.)
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
>
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden