• 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: Reverse of fullPathForApplication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reverse of fullPathForApplication


  • Subject: Re: Reverse of fullPathForApplication
  • From: Audun Wilhelmsen <email@hidden>
  • Date: Fri, 9 Jul 2004 20:24:18 +0200

Try openening the Info.plist file in Application.app/Contents/, then
read the CFBundleName string.

Example code:
NSDictionary *infoList = [NSDictionary dictionaryWithContentsOfFile:
@"/Applications/iTunes.app/Contents/Info.plist"];
NSLog(@"Application name of iTunes: %@", [infoList objectForKey:
@"CFBundleName"]);

Audun Wilhelmsen
------------------------------------------------------------
BrainByte (brainbyte.digitalhybrid.net)
Norway


On 9. jul. 2004, at 18.13, Glen Low wrote:

> Dear All,
>
> If I have an application name and I want to get it's path, I can use
>
> [[NSWorkspace sharedWorkspace] fullPathForApplication: name]
>
> How do I do the reverse? i.e. if I have the path, I want the
> application name.
>
> Some candidates:
>
> 1. [[NSFileManager defaultManager] displayNameAtPath: path] seems to
> be it. But this could end up including the localized bundle name...
> 2. [path lastPathComponent] is another possibility. But something
> nagging at the back of my skull says, is there ever a case where
> fullPathForApplication: xxx doesn't return a path with xxx at the end
> of it??
>
>
> Cheers, Glen Low
>
>
> ---
> pixelglow software | simply brilliant stuff
> www.pixelglow.com
> _______________________________________________
> cocoa-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Reverse of fullPathForApplication
      • From: Douglas Davidson <email@hidden>
References: 
 >Reverse of fullPathForApplication (From: Glen Low <email@hidden>)

  • Prev by Date: No Dock icon
  • Next by Date: Removing scrollbars from WebView
  • Previous by thread: Reverse of fullPathForApplication
  • Next by thread: Re: Reverse of fullPathForApplication
  • Index(es):
    • Date
    • Thread