Re: how do i launch a specific system preference?
Re: how do i launch a specific system preference?
- Subject: Re: how do i launch a specific system preference?
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 08 Oct 2004 10:15:58 -0400
on 2004-10-07 9:20 PM, Ken Victor at email@hidden wrote:
>
i need to be able to launch the system preferences and have it set up
>
to the first tab of the universal access panel. i can do this via:
>
>
[[NSWorkspace sharedWorkspace] openFile:
>
@"/System/Library/PreferencePanes/UniversalAccessPref.prefPane"];
>
>
and it seems to work fine. i'm not sure though about hardcoding such
>
a path into my app. is this the proper way to do this? or is there a
>
better way?
That's close to the way I do it. One user who is running Mac OS X Server
reported that it failed unless System Preferences was already running.
However, he confirmed that the path to this preference pane is the same on
Server. I suspect, from the symptoms he described, that he had a corrupted
Launch Services database that was failing to associate the preference pane
with the System Preferences application.
I actually call -[NSWorkspace openFile:withApplication:], which I would have
thought would launch the correct application even if the Launch Services
database were corrupt. So I can't say I am completely convinced that this is
the correct way to do this. But I've had no other complaints.
The user in question recommended explicitly launching System Preferences
first, then opening the prefpane. This seems like overkill to me, but in a
test application he wrote it apparently cured the problem he was having.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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