什么是applescript,它的用途是什么?
4 回答
Applescript's "big advantage" over other scripting languages (which, frankly are much better to use for most tasks) is that it can automate the action of other applications on your Mac (as long as the developer has provided an Applescript dictionary).
This means that, as Philip Regan described, you can get an application like Photoshop to perform a whole bunch of repetitive photo modifications and then tuck those photos away in a folder, for example.
Other than that, one of the notable features of Applescript is its "English-like" syntax. Apple intended for it to be used by everyday people and tried to make its syntax as close to English as they could. This intention ran into a lot of problems, not the least of which was getting the people who were creating Applescript dictionaries for their applications to respect this goal. Apple also originally intended for there to be an Applescript for other human languages as well and there was work done on a "French Applescript" if I recall correctly.
There are now libraries in scripting languages like Python and Ruby for interfacing with Applescript so you can control the applications using Python or Ruby syntax and not using Applescript syntax (which can be extremely annoying to learn for someone coming from a programming background because of its irregularities and "foreignness").
Apple's latest move to bring application scripting to the everyday user is Automator. I suggest you try it out, as it can be quite useful if your aims are encompassed by things everyone does (keep copies of webpages, etc, etc,)
AppleScript 是一种脚本语言,可用于在 Macintosh 计算机上自动执行操作。
可以使用 AppleScript 自动执行的操作示例包括文件系统操作、文本数据解析、运行程序和调用程序功能。
Applescript Wikipedia Entry是一个好的开始
虽然我同意这里的其他响应者 - 有太多其他网站有这些信息 - 我会告诉你我个人实际用它做什么,希望能更实际地理解它可以做什么而不是您将在其他网站上获得的学术或营销定义...
我为一家出版公司管理一个制作部门,我有几十个脚本,可以让我简化和/或自动化各种流程,包括:
- 使用 Excel、XML 和 InDesign 对营销材料、联系表和简单书籍设计进行全自动页面布局。
- 使用 Illustrator 和 Photoshop 进行大规模图像转换(通常为数百张图像)。
- 自动清理文件(名称、类型和一些文件夹结构)以准备归档。
从本质上讲,我使用 Applescript 来自动执行任何重复性任务,这样我的员工就可以利用他们的时间做更好的事情,而不是一遍又一遍地重复同样的无意识的鼠标点击。我们只需将文件放到从属 Mac 上,启动脚本,完成后它会发出哔哔声。