Linked Questions

Popular Questions

Capture text with pywinauto

Asked by At

I am trying to use pywinauto in Python to capture data from an application. I manage to track down the window I am interested in, but can't seem to access any text within that window.

  1. Instance: print(win):

    hwndwrapper.HwndWrapper - '', Folio Document
  2. Properties: print(win.get_properties()):

    {'class_name': 'Folio Document', 
     'friendly_class_name': 'Folio Document', 
     'texts': [''], 
     'control_id': 0, 
     'rectangle': <RECT L142, T161, R765, B742>, 
     'is_visible': True, 
     'is_enabled': True, 
     'control_count': 0, 'style': 1342177280, 
     'exstyle': 0, 
     'user_data': 0, 
     'context_help_id': 0, 
     'fonts': [<LOGFONTW 'MS Shell Dlg' -11>], 
     'client_rects': [<RECT L0, T0, R623, B581>], 
     'is_unicode': False, 'menu_items': [], 
     'automation_id': ''}
  3. Output from inspect.exe:
    enter image description here

The application I am interested in is called Folio Views. I want to copy the text from a book I own to a text file in order to use it in linux:

enter image description here

The text is selectable as shown above, but not copyable. I also cannot find a way to "see" this text with pywinauto.

How can I find the text within the application?

Related Questions