How to grab text from a dialog box?

Discussion in 'Mac Programming' started by pineapples, Mar 19, 2009.

  1. pineapples macrumors newbie

    Mar 19, 2009

    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 API’s can I use?

  2. pstoehr macrumors member

    Aug 5, 2003
    Scheßlitz, Oberfranken, Bavaria, Germany

    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
  3. pineapples thread starter macrumors newbie

    Mar 19, 2009
    I’d 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.
  4. pineapples thread starter macrumors newbie

    Mar 19, 2009
    Jut one simple question. Can this be done using Python instead of Cocoa.
  5. kainjow Moderator emeritus


    Jun 15, 2000
    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.
  6. Awesomeness macrumors member

    Feb 12, 2009
    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?"
  7. pineapples thread starter macrumors newbie

    Mar 19, 2009
    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?

  8. robbieduncan Moderator emeritus


    Jul 24, 2002

Share This Page