Hi Ken: Thanks for your reply. I see where you're coming from regarding NSWorkspace, and it seems like a great idea! How would you recommend scanning it? A loop or something else more creative? ;) Is there some reason it is better/easier to use the bundle identifiers instead of the name? And I assume you would get this by sorting through NSWorkspace as well.
Pierce On 2/21/09 9:06 AM, "Ken Thomases" <k...@codeweavers.com> wrote: > On Feb 21, 2009, at 10:57 AM, Pierce Freeman wrote: > >> I am having a little trouble finding a way to go from the name of a >> process >> to its PSN. Maybe it's just something I have overlooked, but all the >> documentation seems to be going from the PSN to its name. My goal >> is to use >> the name of a particular process and "kill it" using Apple Events. > > You can scan the array of dictionaries returned by -[NSWorkspace > launchedApplications] for the one which matches your criteria, and get > the PSN from that. > > In general, I recommend that you use the bundle identifier, rather > than the name, to discriminate among applications/processes. > > Cheers, > Ken > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com