Last active
January 10, 2023 23:10
-
-
Save cibomahto/3c47e7b06622aad732cbea4ac11900c4 to your computer and use it in GitHub Desktop.
Press the 'start' button in the Saleae Logic 2 gui
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Saleae Logic 2 GUI has a scripting API, but it's designed for full automation, and doesn't | |
# seem to have a method for telling the GUI to just start a capture. So forget it, let's just | |
# invoke the button ourselves... | |
# | |
# Tested with Windows 10 and Saleae Logic 2.4.3, you'll likely need to tweak this | |
def start_capture(): | |
import pywinauto | |
app = pywinauto.application.Application(backend="uia").connect(title_re="Logic 2.*") | |
i = 0 | |
for window in app.windows(): | |
for c in window.children(): | |
#print('child:', c) | |
for cc in c.children(): | |
#print(' cchild:', type(cc), cc) | |
# the program does not support accessability, guess that the 4th image is the 'start' button | |
if(type(cc) == pywinauto.controls.uiawrapper.UIAWrapper) and (cc.friendly_class_name() == 'Image'): | |
if i == 3: | |
#print(cc, dir(cc)) | |
cc.invoke() | |
i += 1 | |
if __name__ == "__main__": | |
start_capture() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment