首页 > 解决方案 > pywinauto 没有连接到 After Effects?

问题描述

from pywinauto import application
app = application.Application().connect(process=7996)
app.print_control_identifiers()

为什么这段代码不起作用?它会产生错误。

AttributeError: Neither GUI element (wrapper) nor wrapper method 'print_control_identifiers' were found (typo?)

我能想到的唯一原因是它是一个 64 位应用程序,而我有 32 位 Python。

标签: pythonpython-3.xpywinautoafter-effects

解决方案


connect()在您的代码中运行良好。下一行:print_control_identifiers()不是app对象的方法。您需要为此创建顶级窗口规范:

app.TopWindowTitle.print_control_identifiers()

列出顶部窗口标题:

print([w.window_text() for w in app.windows()])

推荐阅读