使用 Python 代替 AppleScript [英] Using Python in Place of AppleScript

查看:23
本文介绍了使用 Python 代替 AppleScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常使用 Applescript 来完成基本任务,例如打开和关闭程序,有时会更深入一些,例如运行特定 Xcode 程序的单元测试.我正在学习 Python,我喜欢它.我没能找到很多关于 AppleScript 和 Python 的文档.我的问题是:在 Mac OS X 上,可以使用 Python 代替 AppleScript 来完成上述任务吗?如果是这样,有没有人知道可以了解有关该主题的更多信息的好资源?

I often use Applescript to accomplish basic tasks like opening and closing programs, sometimes going a little more in-depth like running a specific Xcode program's unit tests. I'm learning Python, and I love it. I haven't been able to find much documentation relating AppleScript to Python. My question is: On Mac OS X, can Python be used in place of AppleScript to accomplish the tasks mentioned above? And if so, does anyone know of a good resource to learn more about the topic?

推荐答案

Python 不能用于替换 UI &AppleScript 提供的自动化职责.但是,由于 OS X 10.10 (Yosemite) JavaScript 也可以使用.

Python can't be used to replace the UI & automation duties that AppleScript offers. However since OS X 10.10 (Yosemite) JavaScript can also be used.

请参阅此处:https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html

这篇关于使用 Python 代替 AppleScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆