Re: Finding the sender of an AppleEvent in Cocoa app on 10.2.8 or greater
Re: Finding the sender of an AppleEvent in Cocoa app on 10.2.8 or greater
- Subject: Re: Finding the sender of an AppleEvent in Cocoa app on 10.2.8 or greater
- From: Shawn Erickson <email@hidden>
- Date: Fri, 14 Jan 2005 12:47:24 -0800
On Jan 14, 2005, at 12:31 PM, Greg Robbins wrote:
At 11:54 AM -0800 1/14/05, Shawn Erickson wrote:
I have tried the various obvious method provided by the AE related
Cocoa class to fetch the original sender (mostly trying to get its
PSN) but it looks like the data isn't in the event since the plugin
doesn't request a reply, etc.
You can register to get the actual event with NSAppleEventManaager's
setEventHandler:andSelector:forEventClass:andEventID: then extract the
sender's signature or ProcessSerialNumber directly from the event:
NSAppleEventDescriptor *addrDesc = [event
attributeDescriptorForKeyword:keyAddressAttr];
Ah I see what I was doing wrong. I was using descriptorForKeyword: when
trying to get keyAddressAttr and that wasn't returning me any thing.
Using attributeDescriptorForKeyword: is getting me what I need.
Thanks!
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden