• 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: Tommy Nordgren <email@hidden>
  • Date: Sat, 20 Sep 2008 18:57:30 +0200


On Sep 18, 2008, at 8:47 PM, Jerry Krinock wrote:

The methods for finding applications,

  -[NSWorkspace fullPathForApplication:]
  -[NSWorkspace absolutePathForAppBundleWithIdentifier:]
  AppleScript's  'path to application'

all return only ONE result. If there is more than installation of the application, which often happens out here in real life, the above methods will often pick different installations, and even if you run the same methods several minutes apart I sometimes get different answers.

Is there any way to make these methods behave deterministically? If not, what's a better way? Do I have to do a Spotlight search? I know that unix 'find' would be way too slow.

Thanks,

Jerry Krinock

Use NSTask with the command line find -x / -name '*.app' Do this on a separate thread, and cache the result.
------

What is a woman that you forsake her, and the hearth fire and the home acre,
to go with the old grey Widow Maker. --Kipling, harp song of the Dane women
Tommy Nordgren
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


  • Follow-Ups:
    • Re: Finding other apps' paths - deterministically!
      • From: "Michael Ash" <email@hidden>
References: 
 >Finding other apps' paths - deterministically! (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Drawing an NSImage in a CALayer
  • Next by Date: Re: NSOperationQueue
  • Previous by thread: Re: Finding other apps' paths - deterministically!
  • Next by thread: Re: Finding other apps' paths - deterministically!
  • Index(es):
    • Date
    • Thread