python - 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。
解决方案
connect()
在您的代码中运行良好。下一行:print_control_identifiers()
不是app
对象的方法。您需要为此创建顶级窗口规范:
app.TopWindowTitle.print_control_identifiers()
列出顶部窗口标题:
print([w.window_text() for w in app.windows()])
推荐阅读
- haskell - `sequenceA (replicate n getChar)` 有什么作用?
- python - 子进程间歇性地返回空
- javascript - 类型错误:_data__WEBPACK_IMPORTED_MODULE_3___default.a.map 不是函数
- python - 如何使用 postgresql 检查 django2.1 中的数据库?
- java - 将数据从第三个活动发送到第一个活动 - 正确的方法?
- ios - 旧的视图控制器在后台仍然可见
- java - 如何为我的自定义可运行方法使用 java lambda 表达式
- node.js - 在 React 和 Node 之间执行客户端请求,都在单独的 Docker 容器中
- django - 你怎么知道要测试什么状态码?
- openstreetmap - 如何将 OSM 与 optaplanner 工作台集成