AppleScript

AppleScript
复制标题

苹果脚本

DOI:
10.1145/1238844.1238845
复制
发表时间:
2007
期刊:
Proceedings of the third ACM SIGPLAN conference on History of programming languages
影响因子:
--
通讯作者:
W. Cook
W. Cook
中科院分区:
--
文献类型:
--
作者:
W. Cook

文献摘要

被引文献

相似文献

AppleScript是一种用于Mac OS的脚本语言和环境。AppleScript最初构思于1989年,它允许终端用户自动执行复杂的任务并自定义Mac OS应用程序。为了自动化任务,AppleScript提供了标准的编程语言特性(控制流、变量、数据结构),并发送Apple Events来调用应用程序行为。Apple Events是标准远程过程调用的一种变体,其中消息可以通过远程应用程序解释的查询来识别它们的参数。这种方法避免了对远程对象指针或代理的需要,并减少了通信往返的次数,这在像早期Macintosh OS这样的高延迟环境中是昂贵的。要定制使用AppleScript的开放脚本架构的应用程序,用户将脚本附加到应用程序对象;然后,这些脚本可以拦截和修改应用程序行为。AppleScript是为普通用户设计的:AppleScript语法类似于自然语言,通过在图形界面上记录手动操作,可以轻松创建脚本。AppleScript还支持国际化,允许脚本以多种方言呈现,包括英语、日语或法语。尽管自然语法易于阅读,但它可能使脚本更难编写。早期的采用受到修改应用程序以支持Apple Events和Open Scripting Architecture的困难的阻碍。然而AppleScript现在被广泛使用,是Mac OS的一个重要区别。AppleScript的通信模型是web服务的先驱,嵌入式脚本的思想已被广泛采用。
AppleScript is a scripting language and environment for the Mac OS. Originally conceived in 1989, AppleScript allows end users to automate complex tasks and customize Mac OS applications. To automate tasks, AppleScript provides standard programming language features (control flow, variables, data structures) and sends Apple Events to invoke application behavior. Apple Events are a variation on standard remote procedure calls in which messages can identify their arguments by queries that are interpreted by the remote application. This approach avoids the need for remote object pointers or proxies, and reduces the number of communication round trips, which are expensive in high latency environments like the early Macintosh OS. To customize an application that uses AppleScript's Open Scripting Architecture, users attach scripts to application objects; these scripts can then intercept and modify application behavior. AppleScript was designed for casual users: AppleScript syntax resembles natural language, and scripts can be created easily by recording manual operations on a graphical interface. AppleScript also supported internationalization in allowing script to be presented in multiple dialects, including English, Japanese, or French. Although the naturalistic syntax is easy to read, it can make scripts much more difficult to write. Early adoption was hindered by the difficulty of modifying applications to support Apple Events and the Open Scripting Architecture. Yet AppleScript is now widely used and is an essential differentiator of the Mac OS. AppleScript's communication model is a precursor to web services, and the idea of embedded scripting has been widely adopted.