嵌入 Mac OS X 10.6 应用程序的最佳脚本语言是什么?

发布于 2024-08-15 13:58:31 字数 85 浏览 3 评论 0原文

是否有任何其他脚本语言可用于在应用程序中嵌入脚本,这些脚本可以访问 Mac OS X,或具有相同功能的应用程序类,或 F-script 中看到的大部分功能?

Is there any other scripting language that can be used to embed scripts inside applications, which can access Mac OS X, or application classes with the same features, or most of the features seen in F-script?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

灯角 2024-08-22 13:58:31

Mac 上支持最好的脚本语言仍然是 AppleScript。但与 F-Script 不同的是,它无法直接访问 Objective-C 级别,它只能使用目标应用程序选择公开的内容来编写脚本。

有适用于 Perl、Python 和 Ruby 的 Objective-C 桥接器。我想这些可以嵌入为您的应用程序提供脚本。

The scripting language with the best support on the Mac is still AppleScript. But unlike F-Script, it cannot directly access the Objective-C level, it can only use what the target application chooses to expose for scripting.

There are Objective-C bridges for Perl, Python, and Ruby. I suppose those can embedded to provide scripting to your application.

忆伤 2024-08-22 13:58:31

Nu 是一个有趣的选择,尽管它还不是很流行。

Nu is an interesting option, although it isn't very popular yet.

长梦不多时 2024-08-22 13:58:31

很多人似乎都喜欢JSTalk

但 Applescript 可能是您最好的选择:集成到系统中等等。

A lot of people seem to like JSTalk.

But probably Applescript is your best bet: integrated into the system and all that.

乖乖兔^ω^ 2024-08-22 13:58:31

出于多种原因,我会说 F-Script。它具有许多独特的功能,并且与 Cocoa 和 Objective-C 运行时极其紧密地集成。例如,您可以检查各种 Finder 类(窗口、图标、coverflow 视图...),并且非常容易(一两行代码)启动或控制其他进程。我认为有任何充分的理由选择AppleScript。它适用于非常短的脚本,但如果您想做更复杂的事情,可能会让您发疯。

另外,MacRuby 当它更加稳定一点时就会变得不稳定,而 一些重要的事情也已经使用 PyObjC 完成了,尽管我认为它不再被积极维护。

I would say F-Script for many reasons. It has many unique features and is extremely tightly integrated with Cocoa and the Objective-C runtime. You can for example inspect various Finder classes (windows, icons, coverflow view...) and it's very easy (one or two lines of code) to start or control other processes. I don't think there is any good reason to prefer AppleScript. It's good for very short scripts, but will probably drive you crazy if you want to do something more complex.

Also, MacRuby is going to rock when it's a bit more stable, and some serious stuff has been accomplished using PyObjC as well, although I don't think it's very actively maintained anymore.

聽兲甴掵 2024-08-22 13:58:31

如果您不需要非常独特的 F-Script 图形自省工具,则可以将一些不错的脚本语言嵌入到应用程序中。请参阅具体的 RubyCocoa(对于 Ruby)、PyObjC(对于 Python)、JSTalk(对于 JavaScript)和 CamelBones(对于 Perl)。它们基于 Cocoa 和外来对象模型之间的桥梁,这导致了一些复杂性。这与 F-Script 不同,F-Script 是直接为 Cocoa 对象模型构建的。准备好后,MacRuby 也可能是一个选择,但操作 Objective-C 对象的语法不是很好(尽管它在 RubyCocoa 上有所改进)。 Nu 也是一个选择:像 F-Script 一样直接为 Cocoa 构建,但具有强烈的 Lisp 风格。

If you don't need F-Script graphical introspection tools, which are quite unique, there are some decent scripting languages that you can embed in applications. See in Particular RubyCocoa (for Ruby), PyObjC (for Python), JSTalk (for JavaScript) and CamelBones (for Perl). They are based on bridges between Cocoa and a foreign object model, which leads to some complexities. This is different from F-Script, which is directly built for the Cocoa object model. When ready, MacRuby might be an option too, but the syntax for manipulating Objective-C objects is not very nice (it improves on RubyCocoa, though). Nu is also an option: directly built for Cocoa like F-Script, but with a strong Lisp flavor.

谁对谁错谁最难过 2024-08-22 13:58:31

MacRuby 是 Ruby 1.9 的实现,它使用 Objective-C 运行时和垃圾收集器。它可以嵌入到 Objective-C 应用程序中
即使最后一个可用版本只有 0.6,据报道它也足够稳定,可以在应用程序中使用。

MacRuby is an implementation of Ruby 1.9 that uses the Objective-C runtime and garbage collector. It can be embedded in a Objective-C application.
Even if the last available version is only 0.6, it is reported to be stable enough to be used in applications.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文