• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I get the NSApplication of other running applications?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How do I get the NSApplication of other running applications? (From: "Alan Smith" <email@hidden>)
 >Re: How do I get the NSApplication of other running applications? (From: "Shawn Erickson" <email@hidden>)
 >Re: How do I get the NSApplication of other running applications? (From: "Alan Smith" <email@hidden>)
 >Re: Re: How do I get the NSApplication of other running applications? (From: "Corey O'Connor" <email@hidden>)
 >Re: Re: How do I get the NSApplication of other running applications? (From: "Alan Smith" <email@hidden>)
 >Re: How do I get the NSApplication of other running applications? (From: Andrew Farmer <email@hidden>)
 >Re: How do I get the NSApplication of other running applications? (From: John Stiles <email@hidden>)
 >Re: How do I get the NSApplication of other running applications? (From: "Alan Smith" <email@hidden>)

  • Prev by Date: [Moderator] EOT Re: How do I get the NSApplication of other running applications?
  • Next by Date: Using UserDefaults properly
  • Previous by thread: Re: How do I get the NSApplication of other running applications?
  • Next by thread: Re: Re: Re: How do I get the NSApplication of other running applications?
  • Index(es):
    • Date
    • Thread