Download Now

[282 KB]
 

What Is ScriptGUI?

ScriptGUI lets you run shell scripts from the finder. If you know what #!/bin/sh means, you need ScriptGUI!

Long-time UNIX users like me have been frustrated by the fact that there's no simple way to make a double-clickable shell script. The UNIX shell has forever had the ability to turn a shell script into an executable simply by setting the "execute" bit. But until now there has been no easy way to carry this behavior over to the Finder.

With Script GUI, you can simply double-click your favorite Perl or shell script and it will run gracefully within a window. And with the handy tabs, you can view (and edit!) the script itself as well. Cool, no?


Scriptlets

When you're ready to share your scripts, ScriptGUI lets you wrap up your scripts in neat little packages called Scriptlets that you can share freely with your friends. Scriptlets are self-contained applications that run by themselves - your friends don't even need ScriptGUI to use them.

Get Me Going, Quickly!

It's simple. If you have Perl scripts ending in .pl, or shell scripts ending in .sh, simply installing ScriptGUI will make those script double-clickable. Couldn't be easier. For any others, you can rename them to end with with .sgui (for ScriptGUI), or .pl or .sh.

If you'd rather not rename your scripts, that's fine too. You can make them open in ScriptGUI using the Finder's "Show Info" box. Select "Show Info" from the File menu, select "Application" from the popup, and make ScriptGUI the "specific application" to launch your script.

How It Works

Script GUI is an OS X application that knows how to run shell scripts. It works basically the same way as your favorite UNIX shell (sh, bash, perl, python, etc.): the UNIX shell reads the script file and checks the first line to see if it looks something like this:

#!/usr/local/perl

This example is for Perl, for instance, but the same thing works for scripts of many kinds. Once it figures out which interpreter to use (Perl in this case), it forks off a child process to run the interpreter, which executes the script. It then reads stdout and stderr and writes out the output to the terminal.

Script GUI works the same way, it just does all this in a handy window.

Known Bugs/"Issues"

These are the things I intend to eventually fix.
  • You can't currently save the output of a script. The "Save" command only works on the script portion of the window - output is ignored for the purposes of "Save". You can cut and paste into some other application and save from there. You can even cut and paste into the "Source" tab and save from there.
  • Script GUI doesn't set the execute bit when saving files, so you can't just use them as executables from the shell. This isn't really a bug, I guess, since vi doesn't do it either, but it seems like the right thing to do. What do you think?
  • You can't set execution controls (run when double-clicked, quit when done) on a per-script basis. I'm weighing the various ways of doing this, and I'll probably get around to it eventually.

Feedback

I love feedback, both positive and negative. (Ok, I like positive feedback better...). Drop me a line at feedback@scriptgui.com. Tell me what you think of ScriptGUI and how you're using it. I use ScriptGUI every day, so I'm interested in your ideas for making ScriptGUI the best it can be.