PDA

View Full Version : Look at the Objects of A Running Application?




rob356
Mar 22, 2009, 02:17 PM
I have started learning Cocoa and I have a question. In an application I am trying it has to get information from other applications, ones that I have not made and do not have the source for. Specifically how can I have an application look at what objects another application has created.

For Example: My application wants to find the value of a slider in another application.
How can I "ask" that other applications slider what its value is? I know how to ask a slider that is part of my own application, so that isn't a problem.

Short Version: Can I see what objects another application has created and talk to them?

Is this possible? Thanks



robbieduncan
Mar 22, 2009, 02:57 PM
I think you can use F-Script Explorer (http://www.fscript.org/documentation/ExploringCocoaWithFScript/index.htm) to explore the objects in another Cocoa app...

Catfish_Man
Mar 22, 2009, 06:29 PM
In general you can't do this. The other application can provide ways to do it, but without its "permission", it would require something quite tricky (inserting your code into its address space, or abusing the accessibility APIs, or something).

rob356
Mar 22, 2009, 06:42 PM
Thanks for the replies. F-Script does exactly what I want, only now I have to figure out how to make F-Script Anywhere integrate into my application, so that I can get the value of stuff from the app it is inserted into, and create a pointer to it. Maybe I could create a pointer to the location of it, but I don't know yet.

Actually, does anyone know if you can use the accessibility framework to find out the value of a progress bar? That seems to be the easiest way now.