Re: How do I get the NSApplication of other running applications?
Re: How do I get the NSApplication of other running applications?
- Subject: Re: How do I get the NSApplication of other running applications?
- From: Eric Schlegel <email@hidden>
- Date: Fri, 8 Sep 2006 15:44:39 -0700
On Sep 8, 2006, at 3:32 PM, Alan Smith wrote:
Can Apple Events return objects/variables? For example: if I told an
app to give me it's NSApplication could I get it (hypothetically)?
An AppleEvent is basically just a storage container for arbitrary
data. You can put any kind of data you want into it, including
pointers, so yes, you could define an AppleEvent that, when an
application received it, would request that the application store its
NSApplication* into the reply AppleEvent.
However, there are these problems:
- as already mentioned, the NSApplication* from any other process is
meaningless inside your process. It's a pointer that does not point to
anything inside your process, and you can't send messages to it or use
it for anything at all
- since no existing application would handle this hypothetical
AppleEvent, you'd never get a response anyways
- Carbon apps don't have NSApplication instances
I think you need to describe exactly what functionality you need from
NSApplication, and then maybe we can recommend other ways of getting
that information.
-eric
_______________________________________________
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