2

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?

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.