tags:

views:

55

answers:

2

It's trivial to make a program executable from shell - just put #!/usr/bin/ruby on top, chmod +x it and done. Unfortunately OSX won't let me associate file type with such scripts - it requires its .apps instead. This sort of distinction doesn't seem to exist on other operating systems.

What's the simplest way of making such .app, which would merely execute some arbitrary Ruby code?

+2  A: 

You could use Automator or create an AppleScript application using "do shell script" to execute your Ruby script.

agregoire
And how would I associate AppleScript snippet with a file type?
taw
The AppleScript application that you'll create will run as is. You won't need to associate it with a file type. There are two ways to create one: Xcode has a template for a Cocoa-AppleScript application. Alternatively, with the AppleScript editor, you can also save your script as an application.
agregoire
A: 

It seems that Script Editor has "Save as Application Bundle" option, which creates foo.app which I can associate with file types.

taw