• 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: Finding other apps' paths - deterministically!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding other apps' paths - deterministically!


  • Subject: Re: Finding other apps' paths - deterministically!
  • From: Jerry Krinock <email@hidden>
  • Date: Wed, 1 Oct 2008 13:43:32 -0700


On 2008 Sep, 30, at 12:50, Michael Ash wrote:

Of course if [your helper] isn't registered to open documents
then this doesn't work so great.

Yes, that's the problem. It's a background kind of a guy. It doesn't open documents of any kind.


As for multiple installations, I don't see any evidence that [LSCopyApplicationURLsForURL()]
*wouldn't* return multiple installations, and it's a fair assumption
that it would based on the probability that the Finder uses this API
for things like the Open With... menu.

Well, based on the fact that Finder only launches one app, I was expecting the opposite. But since I started this thread, I did a test, and to my surprise, Michael is correct!


I copied OmniOutliner.app to my desktop, gave LSCopyApplicationURLsForURL the url of an OmniOutliner document, and it found both copies of the app...

NSURL* url = [NSURL fileURLWithPath:@"/Users/jk/Desktop/ Firefox3Database.oo3"] ;
CFArrayRef finds = LSCopyApplicationURLsForURL (
(CFURLRef) url,
kLSRolesAll
) ;
NSLog([(NSArray*)finds description]) ;


*** Output:

(
    file://localhost/Applications/OmniOutliner.app/,
    file://localhost/Users/jk/Desktop/OmniOutliner.app/
)

So, this is very easy solution, for finding document-based apps.

_______________________________________________

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


  • Prev by Date: Re: Remove Duplicates in a NSArray
  • Next by Date: Re: NSString's "mutableCopy" creating a leak?
  • Previous by thread: Re: Finding other apps' paths - deterministically!
  • Next by thread: -[NSScanner scanUpToString:stopString:NULL] - 10.3.9 Crash, due Xcode 3.1?
  • Index(es):
    • Date
    • Thread