• 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: Access main window of other Applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Access main window of other Applications


  • Subject: Re: Access main window of other Applications
  • From: Peter Lübke <email@hidden>
  • Date: Fri, 08 Apr 2011 10:34:44 +0200


Am 07.04.2011 um 17:01 schrieb Florian Pilz:

Hi there!

I'm looking for an easy way to access the main window of another
Application, thus not my own. (The key window would be fine as well,
if that is easier.)
I already searched via Google to solve this task and I found the
following solutions:

* use AppleScript to perform this task and integrate it into the
Objective-C/Cocoa App with a Wrapper class, i.e. NSAppleScript
* use Quartz Window Services
* use the NSAccessibility Protocol

All three solution don't satisfy me, because a) I wanted to perform
the task in Objective-C (not AppleScript)
There's nothing bad about using Cocoa NSAppleScript in a Cocoa app.
Presumed the target app is scriptable.

(Apple Script:)
tell application "<someAppName>"
	set theWindow to window 1
end tell

, b) the Quartz API looks
complicated and inappropriate (maybe I'm wrong - feel free to correct
me) and

c) I couldn't find any examples on using the NSAccessibility
protocol to retrieve the main window,
kAXMainWindowAttribute

not mentioning the discomfort
that the user may activate access to accessibility features first.

Agreed.

The answer depends on your goal. Which information do you need about the window? Do you want to change its properties?

- Peter
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >Access main window of other Applications (From: Florian Pilz <email@hidden>)

  • Prev by Date: Re: Localized sorting of a Core Data entity
  • Next by Date: Re: How To Increment CALayer Retain Count?
  • Previous by thread: Re: Access main window of other Applications
  • Next by thread: Re: Access main window of other Applications
  • Index(es):
    • Date
    • Thread