capturing text from a GUI window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Earl Eiland

    #1

    capturing text from a GUI window

    Anyone know how to capture text from GUI output? I need to process
    information returned via a GUI window.

    Earl

  • Peter Hansen

    #2
    Re: capturing text from a GUI window

    Earl Eiland wrote:[color=blue]
    > Anyone know how to capture text from GUI output? I need to process
    > information returned via a GUI window.[/color]

    It might help (at least in terms of justifying this as an
    on-topic post) to describe in what way this is a Python
    question. Is it a Python program that produces the output?
    Do you want to write this capture program using Python?

    Also, as always, providing some detail about the platform
    in question is important if you don't want to see answers
    of the form "we're not mindreaders". Operating system,
    GUI framework, versions of things.

    Finally, note that the process is, when possible at all,
    generally highly platform-specific, awkward, and usually
    relies on third-party packages (at least in Windows) that
    may or may not have any Python-specific interfaces
    available.

    -Peter

    Comment

    • noah@noah.org

      #3
      Re: capturing text from a GUI window


      Earl Eiland wrote:[color=blue]
      > Anyone know how to capture text from GUI output? I need to process
      > information returned via a GUI window.
      >
      > Earl[/color]

      Assuming Windows, then these guys have an interesting tool:

      It's not free, but you can try it before you buy it.
      You will need COM to control it from Python.

      Noah

      Comment

      • Earl Eiland

        #4
        Re: capturing text from a GUI window

        On Tue, 2005-03-08 at 14:27, noah@noah.org wrote:[color=blue]
        > Earl Eiland wrote:[color=green]
        > > Anyone know how to capture text from GUI output? I need to process
        > > information returned via a GUI window.
        > >
        > > Earl[/color]
        >
        > Assuming Windows, then these guys have an interesting tool:
        > http://www.skesoft.com/textcatch.htm
        > It's not free, but you can try it before you buy it.
        > You will need COM to control it from Python.[/color]

        This sounds like just what I need. What is COM, and where do I get it?
        (I'm really a Linux guy. I don't ken the mysteries of Window very well.)

        earl

        Comment

        • Myles Strous

          #5
          Re: capturing text from a GUI window

          Earl Eiland wrote:[color=blue]
          > This sounds like just what I need. What is COM, and where do I get[/color]
          it?

          Also worth checking out:

          Simon Brunning's WinGuiAuto - control/query of windows and controls,
          including the function getEditText to read the text in an edit control.
          See http://www.brunningonline.net/simon/...es/001129.html
          You'll probably also need something like Winspector to get class names
          etc - see http://www.windows-spy.com/

          AutoIt3 - freeware, has a DLL version that is COM-controllable (after
          registration using "regsvr32 AutoItX3.dll" from a console window). I
          must admit that so far I've only ever used version 2 through COM.
          Includes functions such as ControlGetText and WinGetText, and throws in
          a separate spy/info program as well. See
          AutoIt is a freeware BASIC-like scripting language designed for automating the Windows GUI and general purpose scripting.


          COM (component object model) - inter-component communication
          technology. See http://www.microsoft.com/com/default.mspx

          Makes it easy for programs with COM client functonality to use/control
          functions exposed in a COM server program (well, that's the Dispatch
          part of it that's applicable to your situation, it's apparently a fair
          bit more than that).

          Mark Hammond's Python for Windows extensions (thank you Mark Hammond!),
          also known as Win32All or PyWin32, adds COM client funcionality to
          Python.
          (Note: Python+PyWin32 also does COM server stuff, but you don't need to
          know about that.)

          Use the COM Makepy utility (under the Tools menu) in PythonWin (the IDE
          that comes with the Python for Windows extensions) to get a nice
          interface module for your chosen COM server component, then just call
          the functions in the interface module (or whatever the correct
          technical name is for the generated .py file).

          Worth reading:


          Example Python uses of COM server components:



          http://www.daniweb.com/code/snippet208.html
          http://tinyurl.com/42rxa

          (Using a COM component is very similar in a variety of programming
          languages)

          In case you don't already have the Python for Windows extensions, or
          the ActiveState Python distribution which includes them: see
          http://sourceforge.net/projects/pywin32/

          Regards, Myles.

          Comment

          • Josef Meile

            #6
            Re: capturing text from a GUI window

            Hi Earl,
            [color=blue][color=green][color=darkred]
            >>>Anyone know how to capture text from GUI output? I need to process
            >>>informatio n returned via a GUI window.
            >>>
            >>>Earl[/color]
            >>
            >>Assuming Windows, then these guys have an interesting tool:
            >> http://www.skesoft.com/textcatch.htm
            >>It's not free, but you can try it before you buy it.
            >>You will need COM to control it from Python.[/color]
            >
            >
            > This sounds like just what I need. What is COM, and where do I get it?
            > (I'm really a Linux guy. I don't ken the mysteries of Window very well.)[/color]
            You may also try WATSUP - Windows Application Test System Using Python:
            页面未找到 | 黑豹加速器 heibao heibaoVPN heibao加速器 黑豹加速器


            Now the website seems to be down, but perhaps there is a mirror
            somewhere.

            Regards,
            Josef

            Comment

            Working...