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: Andrew Farmer <email@hidden>
- Date: Fri, 8 Sep 2006 20:01:18 -0700
On 08 Sep 06, at 15:32, 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)?
First question: Sort of; not really. Apple Events can return references
to certain types of objects, but they are _not_ a distributed object
mechanism by any stretch of the imagination. For example, the script:
tell application "Mail"
get first message of mailbox "Cocoa"
end tell
returns an Applescript reference to the message in question which can
only be manipulated by sending further Apple Events to the Mail
application. I'm not all that familiar with the framework, but I
believe that all you end up with is an opaque "cookie" which you can
pass back in for further operations.
Second question: Absolutely not. The NSApplication object is not
exposed by AppleScript in any meaningful fashion. As John Stiles
points out, many applications expose a few basic operations like
activate, reopen, and quit, but these are separate from the
operations which the Dock can (and must) perform.
In general, AppleScript will not help you here. In fact, no published
API will, because the Dock makes heavy use of Mach messaging and/or
undocumented frameworks to communicate with applications.
Alpha/omega: YOU ARE ON YOUR OWN HERE. If you really want to
reimplement the Dock, you should expect to do some massive
reverse-engineering.
_______________________________________________
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