Skip navigation.
 
mlRe: Traversing windows with Cocoa
FROM : Eric Schlegel
DATE : Mon Mar 03 23:31:14 2008

On Mar 3, 2008, at 1:10 PM, aldo kurnia wrote:

> So, I looked at Accessiblity API and NSApplication looks somewhat 
> promising because it can give out its NSWindow children reference 
> and there are functions to activate them. One missing piece of the 
> puzzle though, is that I couldn't find any way to get a list of 
> system-wide processes and create a NSApplication reference to them. 
> Does anyone has any idea about this?


There isn't any way to create NSApplication instances for processes 
other than your own.

The Accessibility API (_not_ AppleScript) is clearly the right way to 
go here. With Accessibility you can get information about the windows 
in other processes, including their titles, and then compare those 
titles to your desired window title. AppleScript is not sufficient for 
this task because not all applications implement the AppleScript 
scripting interface that you'd need to get this info.

-eric

Related mailsAuthorDate
mlTraversing windows with Cocoa aldo kurnia Mar 3, 22:10
mlRe: Traversing windows with Cocoa I. Savant Mar 3, 22:13
mlRe: Traversing windows with Cocoa Jens Alfke Mar 3, 23:16
mlRe: Traversing windows with Cocoa Eric Schlegel Mar 3, 23:31
mlRe: Traversing windows with Cocoa aldo kurnia Mar 3, 23:45
mlRe: Traversing windows with Cocoa Bill Cheeseman Mar 4, 12:31
mlRe: Traversing windows with Cocoa Bill Cheeseman Mar 4, 12:33
mlRe: Traversing windows with Cocoa Stephan Burlot Mar 4, 18:45
mlRe: Traversing windows with Cocoa aldo kurnia Mar 5, 01:02