PDA

View Full Version : How to grab text from a dialog box?




pineapples
Mar 19, 2009, 07:14 AM
Hi,

I need to grab a string of text from a textbox, checkbox or label etc from a dialog box. I know this can be done using Visual Basic for Windows using the Windows API Functions.

But can the same concept be done on OS X? If so, what program do you recommend and what APIs can I use?

Thanks



pstoehr
Mar 19, 2009, 07:33 AM
Hi,

what do you mean by "grab text from a dialog box"?
Are you going to write a new application was a GUI? If yes, you should have a look at Cocoa.

Best regards
Peter

pineapples
Mar 19, 2009, 09:24 AM
Id like to copy any text from a dialog box so I can then paste it into a text document simply by clicking on the string of text in the dialog box.

pineapples
Mar 25, 2009, 04:41 AM
Jut one simple question. Can this be done using Python instead of Cocoa.

kainjow
Mar 25, 2009, 12:58 PM
If this is for dialogs outside of your application, you will need to learn the accessibility APIs. If it's for your own app, just write your own custom dialog windows.

Python is a language, Cocoa is a framework. You can use Python to program Cocoa apps. Start reading here (http://developer.apple.com/cocoa/pyobjc.html).

Awesomeness
Mar 25, 2009, 05:03 PM
Jut one simple question. Can this be done using Python instead of Cocoa.

I just use Java and the Jar bundler. Making apps in Java is waayyyy easier. They even let you make the menus look native and stuff. everything.
In think you should switch to Java sometime. I actually think it's EASIER than Python once you've mastered Python, because it's easier to learn new languages.

Also, use proper English. "Can this be done using Python instead of Cocoa?"

pineapples
Apr 8, 2009, 04:20 AM
Hi, thanks for feedback! I'm currently looking into Java Netbeans for the Mac. Netbeans looks nice and slick! Now, my question...!

I want to retrieve/pull text from controls such as combo boxes, list boxes and text boxes and static text[Labels] within any application other than my own from which I want to pull this text.

In Windows program I would use Windows API functions (E.g. Like GetWindowText). Is there any equivalent API functions for Mac that I can use for my Java program? Is there a site listing all API functions for Mac along with how to use them to get me started?

Thanks!

robbieduncan
Apr 8, 2009, 05:31 AM
Is there a site listing all API functions for Mac along with how to use them to get me started?

developer.apple.com (http://developer.apple.com)