• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: App name from Bundle Identifier?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: App name from Bundle Identifier?


  • Subject: Re: App name from Bundle Identifier?
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 12 Sep 2008 16:32:53 -0500

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 (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

_______________________________________________

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


References: 
 >App name from Bundle Identifier? (From: Dave DeLong <email@hidden>)
 >Re: App name from Bundle Identifier? (From: Jamie Hardt <email@hidden>)
 >Re: App name from Bundle Identifier? (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: Transparent Background for a Progress Indicator (NSView)
  • Next by Date: Re: App name from Bundle Identifier?
  • Previous by thread: Re: App name from Bundle Identifier?
  • Next by thread: Re: App name from Bundle Identifier?
  • Index(es):
    • Date
    • Thread