pywinauto无法连接到After Effects?

时间:2018-09-20 21:22:04

标签: python python-3.x 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。

1 个答案:

答案 0 :(得分:0)

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

app.TopWindowTitle.print_control_identifiers()

列出顶部窗口标题:

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