If you want the name displayed by the Finder, you want - [NSFileManager displayNameAtPath:].

If you want the name the app claims for itself, you want -[NSBundle objectForInfoDictionaryKey:] called on the bundle obtained from the path, passing (id)kCFBundleNameKey as the key.

Cheers,
Ken

On Sep 12, 2008, at 4:21 PM, Dave DeLong wrote:

Thanks for the idea. I'm sure it will work under most situations, but there are times when what's displayed in the Finder (ie it's absolute path) is not necessarily the same thing as the actual application name.

For example, I have BBEdit 8 and BBEdit 9 (trial) right now. BBEdit 8 is at "/Applications/BBEdit.app", and BBEdit 9 is at "/ Applications/BBEdit 9.app", yet they both have the same "NSApplicationName"/CFBundleName of "BBEdit".

I'd like to have a method that will always work, no matter what the path is. If that's not possible, then what you outlined is the next best thing.

Thanks!

Dave

On Sep 12, 2008, at 3:16 PM, Jamie Hardt wrote:

Dave-

Just a thought....

NSString *path = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:bundleIdentifier];

NSString *appName = [[path lastPathComponent] stringByDeletingPathExtension];

On Sep 12, 2008, at 2:06 PM, Dave DeLong wrote:

Hi everyone,

I've been looking inside NSWorkspace, NSBundle, NSApplication, NSFileWrapper, etc for some way to get the display name of an application from it's bundle identifier, but I can't find anything. Is there a way to do this? For example, if I have "com.apple.InterfaceBuilder3", I'd like to get back "Interface Builder".

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/ken%40codeweavers.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to