• 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: Find app by signature
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find app by signature


  • Subject: Re: Find app by signature
  • From: Vince DeMarco <email@hidden>
  • Date: Mon, 31 Mar 2003 14:50:14 -0800

On Monday, March 31, 2003, at 2:04 PM, Greg Robbins wrote:

At 4:25 PM -0500 3/31/03, Steve Roy wrote:
I'm looking at NSWorkspace hoping to find a method to locate an application
given its 4-byte signature (creator code).

Use LSGetApplicationForInfo, from LaunchServices.h, to get the FSRef for the application given its OSType signature:

const OSType kAnyFileType = kLSUnknownType;
const CFStringRef kAnyExtension = NULL;
CFURLRef* kDontWantURL = NULL;
FSRef appFSRef;

OSStatus err = LSGetApplicationForInfo(kAnyFileType, signature, kAnyExtension, kLSRolesAll, &appFSRef, kDontWantURL);

You can use CFURLCreateFromFSRef to make an NSURL from the FSRef.


Or you can just get


OSStatus err = LSGetApplicationForInfo(kAnyFileType, signature, kAnyExtension, kLSRolesAll, NULL, &urlToApp)

and urlToApp will be a url to the application you want.

vince
_______________________________________________
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.

References: 
 >Find app by signature (From: Steve Roy <email@hidden>)
 >Re: Find app by signature (From: Greg Robbins <email@hidden>)

  • Prev by Date: Preload compiled AppleScript?
  • Next by Date: Re: NSCopyBits
  • Previous by thread: Re: Find app by signature
  • Next by thread: Preload compiled AppleScript?
  • Index(es):
    • Date
    • Thread