Is it possible to make a Cocoa app scriptable using Ruby instead of AppleScript? Any reasons why I shouldn’t?
Even if one has to use AppleScript, there are still the following alternatives:
- The AppleScript dictionary only contains one “function”: “sendRubyScriptToApp”. What this “function” (not sure what they’re called in AppleScript) does is to simply pass a string containing the entire Ruby script that the app accepts.
- Use AppleScript in the regular way.
What would be some advantages and drawbacks?
I think there are many disadvantages of going against the grain with AppleScript. Mainly because you have to then embed a ruby runtime in your application to get your idea to work. I suggest using AppleScript the regular way and then using rb-appscript to script your app. Rb-Appscript will allow you to create ruby code that interfaces with your application via AppleScript.