Re: Open System Preferences?
Re: Open System Preferences?
- Subject: Re: Open System Preferences?
- From: Rosyna <email@hidden>
- Date: Sun, 16 Apr 2006 10:54:11 -0700
I'm a masochist so I couldn't even suggest doing that. I'd go with
FSFindFolder with kPreferencePanesFolderType and then iterating the
folder making NSBundles out of each item until I found the one with
the com.apple.preference.speech bundle ID.
Barring masochism, I still think Brian's suggestion of using
AppleScript is by far the best way to go. It completely avoids the
file system altogether and it's rather easy to implement.
But remember, d2kagw, both of these will fail miserably if the
preference pane is installed in the home folder and the user has
changed the case of his home folder (for example, wanting it to be
Thomas instead of thomas). In fact, System Preferences may even
*delete* your preference pane altogether. In the worst case, it could
cause the home folder to "disappear" altogether depending on how the
user setup his home folder. It's a very nasty bug.
Actually, I'm not sure if the AppleScript example suffers from this
bug if the System Preferences just switches to the preference pane
rather than handling it through an open document handler.
Ack, at 4/16/06, Ali Ozer said:
NSWorkspace is even a better form of this; a little more impedance match.
However in either the NSWorkspace or LaunchServices cases it would
be best to get at the /System/Library folder dynamically, something
like:
NSArray *paths =
NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSSystemDomainMask, NO);
return ([paths count] == 0) ? NO : [NSWorkspace openFile:[[paths
objectAtIndex:0]
stringByAppendingPathComponent:@"PreferencePanes/Speech.prefPane"]];
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
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