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

Reply via email to