Re: Do constants exist for the standard application names when using NSWorkspace launchApplication?
Re: Do constants exist for the standard application names when using NSWorkspace launchApplication?
- Subject: Re: Do constants exist for the standard application names when using NSWorkspace launchApplication?
- From: "Sean McBride" <email@hidden>
- Date: Fri, 29 Apr 2005 10:14:00 -0400
- Organization: Rogue Research
On 2005-04-29 12:58, Ondra Cada said:
>> I presume however that "Address Book" carries a different name on
>> non-English systems? Would I be correct in assuming that my
>> NSWorkspace
>> call therefore wouldn't work in that case?
>
>Nope. This is neither OS 9 nor Windoze :)
>
>All application names remain the same in all localizations (at least,
>for a properly written applications). It's only Finder level which
>shows the localised name.
But users are still free to rename and move applications, so you CANNOT
rely on any hardcoded path or hardcoded application name. This is
something that was done really well on OS 9, and is still really done
poorly in OS X. I just don't understand why so many developers like to
hardcode these things. :(
Repeat after me "paths are fragile!"
Here's the right way:
NSWorkspace* ws = [NSWorkspace sharedWorkspace];
NSString* abPath = [ws absolutePathForAppBundleWithIdentifier:
@"com.apple.AddressBook"];
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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