Bundling REBOL Scripts

A rough guide to wrapping REBOL scripts in an OS X App Bundle.

REBOL.icns (see below)
REBOL.icns (see below)

Structure

This is the minimal setup for an application bundle:

MyScript.app/
Contents/
MacOS/
MyScript
Resources/
my-script.r
REBOL/
View

Both MyScript and View must have executable permissions, e.g. chmod 755

MyScript is just a plain text shell script:

#!/bin/sh

BASEDIR=$(dirname $(dirname $0))/Resources
exec $BASEDIR/REBOL/View $BASEDIR/my-script.r

View is the REBOL executable.  Unless you create an Info.plist file for your app, MyScript should match your MyScript.app bundle name.  Your working path will be MyScript.app/Contents/Resources/ — you can put all your images and support files there.

Future

I’d like to devise a way to pass arguments, specifically to assign filetypes.  My fear is that it may get to complex (note: this is not the same as assigning .r types to REBOL)

More

  • Take a look at Ashley’s CookBook for bundling encapped SDK applications as well as adding metadata to your bundle.
  • Robert has created an AppleScript bundle that will assign specified filetypes to REBOL.
  • An unofficial REBOL icns icon file for use (requires the Info.plist to set).
  • system/options should give you access to all important directories, such as system/options/home, system/options/path or clean-path system/options/script.
REBOL File Icon
REBOL File Icon