3

Is there a way to get the list of windows from another application and their bounds. E.g. using F-Script or obj-c or any other way (except AppleScript) to access the window contents of another (any other) Cocoa-based application and possibly modify it?

I am talking about 1) accessing the data (as http://the.layersapp.com/ does) and 2) modifying it

...externally

Larry Osterman
  • 16,086
  • 32
  • 60
ktolis
  • 443
  • 1
  • 3
  • 14

1 Answers1

1

See these Stack Overflow questions: Getting the main window of other app, getting the unique ID of another app in OS X. Basically, the two APIs you can use is Accessibility and CGWindow.

Community
  • 1
  • 1
Yuji
  • 34,103
  • 3
  • 70
  • 88
  • I think Son of Grab is quite close to what I am asking but if this is the only way then I'd appreciate some (simpler) sample code other than that from the Apple sample project. – ktolis Feb 01 '10 at 23:24
  • 1
    I don't know any, maybe someone else here can help you. Remember, modifying the GUI state of other programs from yours is a rather advanced technique. So everyone assumes you know what you're doing. Good luck! – Yuji Feb 01 '10 at 23:53