双击运行applescript [英] run applescript on 2x-click

查看:42
本文介绍了双击运行applescript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这感觉像是一个白痴问题,但我被卡住了 - 我不知道关于 AppleScript 的第一件事.我有一个 .scpt 文件,我想双击它并让它运行,但每次单击时,它都会打开 AppleScript 编辑器.感觉它应该只是文件中的一个选项,但我遗漏了一些明显的东西.

OK, this feels like an idiot question, but I'm stuck - I don't know the first thing about AppleScript. I have a .scpt file and I want to double-click it and just have it run, but instead every time I click, it opens up the AppleScript Editor. This feels like it should just be an option on the file, but I'm missing something obvious.

请帮助我不那么愚蠢,谢谢.

Please help me feel less dumb, thank you.

推荐答案

从文件"菜单中,选择导出";文件浏览器下方会有一个文件格式"下拉菜单.要获得可双击的应用程序而不是文档,请选择应用程序".这将生成一个 .app 包,就像普通的 Mac 应用程序一样(如果需要,这也可以让你用你的脚本打包其他资源).您可以选择仅运行"或不运行";如果你这样做了,那么任何只有 .app 的人将无法进一步编辑你的脚本,因为它会被编译.(但如果您将副本另存为应用程序,那可能就是您想要的.)

From the "File" menu, choose "Export"; there’ll be a "File Format" dropdown underneath the file browser. To get a double-clickable application instead of a document, choose "Application". This will produce a .app bundle like ordinary Mac applications (this will also let you package other resources with your script if you need to). You can choose "Run Only" or not; if you do, then anybody with just the .app won’t be able to edit your script further, since it’ll be compiled. (But if you’re saving a copy as the application, that might be what you want.)

另一种选择,根据 Ask Different 上的匿名用户,将您的文件保存/导出为一个脚本"(.scpt)或脚本包"(.scptd),将其保存在~/Library/Scripts/中,然后在脚本编辑器的首选项中选中在菜单栏中显示脚本菜单".

Another option, as per an anonymous user on Ask Different, would be to save/export your file as a "Script" (.scpt) or "Script Bundle" (.scptd), save it in ~/Library/Scripts/, and check "Show Script menu in menu bar" in Script Editor’s preferences.

(如果您运行的是旧版本的 OS X,此答案的第一个版本包含您的信息正在寻找.)

(If you’re running an old version of OS X, the first version of this answer has the information you’re looking for.)

这篇关于双击运行applescript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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