Re: NSWorkspace - getting info about other applications
Re: NSWorkspace - getting info about other applications
- Subject: Re: NSWorkspace - getting info about other applications
- From: Douglas Davidson <email@hidden>
- Date: Fri, 6 Sep 2002 09:49:48 -0700
On Friday, September 6, 2002, at 06:52 AM, Jeremy Dronfield wrote:
There have been several questions & answers lately relating to
NSWorkspace, but none of them provide me with any clues for this
problem. I have several applications which share the same user
defaults (and therefore the same bundle identifier). I'm building an
app which acts as a central co-ordinator for these other apps, getting
and displaying information about them, and I need to know how to get
the information.
The information I want to access is:
- Two Items ("SR1" and "SR2") from each bundle's infoDictionary;
- A value from the shared user defaults (not a problem - just listed
here to illustrate).
I can't find anything in NSWorkspace that seems to fit. The reason for
this, in part, is that this application has to accommodate later
applications with unpredictable names being added to the set. The only
thing they will have in common will be the said bundle identifier. I
have a workaround in mind (building each app so that it automatically
deposits those infoDictionary values in the defaults file when it
runs, and then working from there) but I'd like to know if there's a
"cleaner" approach.
The bundle identifier is intended to uniquely identify an individual
application or other bundle; when you have several applications that
share some common preferences, the approach is to define a separate
suite identifier, distinct from any of their bundle identifiers, rather
than to give them the same bundle identifier. See the documentation on
"Application Suite Preferences" for more information.
I believe Launch Services provides means of locating applications by
bundle identifier, or to iterate through the list of applications.
That could be used to locate applications whose bundle identifiers
shared a common prefix, e.g. "com.mycompany.bigsuite.*". However, your
workaround actually sounds quite reasonable to me.
Douglas Davidson
_______________________________________________
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.