Xcode 是否能够在 IDE 中显示 .scpt 文件,还是必须启动 AppleScript 编辑器?
我遇到了一个奇怪的问题,我在 Xcode 3.1.2 中打开了 Xcode 的源代码项目(可能是版本 2 或更早版本),当我单击属于项目一部分的 Apple 脚本 (.scpt) 文件时,它显示了它们在 Xcode 编辑器中,就像它们是源代码文件一样,但将它们显示为乱码。
当我右键单击并使用“获取信息”时,我可以看到编码和文件类型为空白(未设置)。我删除了 .scpt 文件并将它们重新添加到 Xcode 项目中。现在它们出现了,我在 Xcode 内置编辑器中没有得到垃圾,但我必须单击一次,然后再次单击才能启动脚本编辑器工具,这似乎是查看和编辑这些的唯一方法。
问题:
(1) .scpt 文件是某种二进制文件吗? (我是 applescript 和 Xcode 的新手)。如果是这样,有没有办法将它们转换为纯文本,并且仍然让它们达到预期目的(作为苹果脚本执行)?
(2) Xcode 运行正常吗?我正确地解决了这个问题吗? (删除并重新添加似乎解决了文件类型和编码方面的混乱问题。)
I had a weird problem, where I opened up a source code project for Xcode (probably version 2 or earlier) in Xcode 3.1.2, and when I clicked on apple script (.scpt) files that are part of the project it displayed them inside the Xcode editor as if they were source code files, but showed them as gibberish.
When I right clicked and used Get Info, I could see that the encoding and file types were blank (not set up). I removed the .scpt files and re-added them to the Xcode project. Now they show up, and I don't get garbage in the Xcode built-in editor, but I have to click once, and then again, to launch the Script Editor tool, which seems to be the only way to view and edit these.
Questions:
(1) Are .scpt files some kind of binary thing? (I'm new to applescript and Xcode). If so, is there a way to convert them to plain text and still have them work for their intended purpose (be executed as apple scripts)?
(2) Is Xcode behaving properly? Did I solve this problem correctly? (Remove and re-add seems to have made it fix its confusion over filetype and encoding.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
.scpt 文件是已编译的脚本文件。脚本编辑器可以将它们反编译为格式化文本,然后将它们重新编译回已编译的脚本。
(AppleScript 文本的未编译形式的扩展名为 .applescript)
Xcode 3.2 之前的 Xcode 版本有一个名为 AppleScript Studio 的扩展,该扩展(除其他外)向 Xcode IDE 添加了 AppleScript 编辑器。这在 Xcode 3.2 中被删除,因此您现在必须使用外部 AppleScript 编辑器来编辑 AppleScript 编译的脚本文件。
.scpt files are compiled script files. The Script Editor can decompile them into formatted text, and recompile them back into compiled scripts.
(The uncompiled form of AppleScript text has the extension .applescript)
Versions of Xcode prior to Xcode 3.2 had an extension called AppleScript Studio that (among other things) added an AppleScript editor to the Xcode IDE. This was removed in Xcode 3.2, so you now must use the external AppleScript Editor to edit AppleScript compiled script files.