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

查看:268
本文介绍了使用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天全站免登陆