How to grab text from a dialog box?

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

  1. macrumors newbie

    Joined:
    Mar 19, 2009
    #1
    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 API’s can I use?

    Thanks
     
  2. macrumors member

    Joined:
    Aug 5, 2003
    Location:
    Scheßlitz, Oberfranken, Bavaria, Germany
    #2
    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
     
  3. thread starter macrumors newbie

    Joined:
    Mar 19, 2009
    #3
    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. thread starter macrumors newbie

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

    kainjow

    Joined:
    Jun 15, 2000
    #5
    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. macrumors member

    Joined:
    Feb 12, 2009
    #6
    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. thread starter macrumors newbie

    Joined:
    Mar 19, 2009
    #7
    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!
     
  8. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    developer.apple.com
     

Share This Page