Re: Reverse of fullPathForApplication
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.