Use Platypus to create apps from scripts

Nov 12, '04 10:57:00AM

Contributed by: TigerKR

I recently read a hint about enabling email over ssh. I've been trying to set that up on Mac OS X since I switched (from OS 9), but I always received an odd error, and it never worked, no matter how much research I did, and how many different options I tried. It worked for tunneling ftp, http, and all sorts of other protocols. It's a straight-forward setup:

ssh -CN -L 2025:mail.isp.com:25 -L 2110:mail.isp.com:110 \
 myshortname@localhost
Then set Mail.app to use localhost as the SMTP and POP3 servers, and set the ports to 2025 and 2110 respectively. Oh well, for some reason, now it works. Which lead me to try to discover a way of automating the task when my user account logs in. Read the rest of the hint for my solution...

After some searching, I found a fantastic application called Platypus. From their website:

Platypus is a powerful developer tool for creating application wrappers around scripts, i.e. for creating MacOS X applications that execute a bundled script. Scripts can thus be run seamlessly from the graphical window environment, making elegant Mac OS X-native applications from scripts. Here are some of the features Platypus has to offer: Creating installers, maintenance applications, login items and droplets is very easy using Platypus.
So I created a simple shell script:
#!/bin/sh

##
# SSH Mail Tunnel Opener
# opens ssh tunnels for smtp (2025) and pop3 (2110)
##

/usr/bin/ssh -CN -L 2110:mail.isp.com:110 -L 2025:mail.isp.com:25 \
 myshortname@localhost
Then I used Platypus to create an application with no interface (it can even be a background app which will not show up in the dock -- which Platypus can handle for you), I pointed it to my script, and I had an application I could add to my user startup items with no user interface, no mess, and the process is completely automated.

I'm going to use this program to create all sorts of little apps for stuff I used to have to enter into the command line. Yes, I know I could have used a program like SSH Tunnel manager, but for some reason, I didn't want to go that route.

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20041111082112274