Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

flyingscott

macrumors regular
Original poster
Nov 2, 2007
189
1
Michigan
I have a number of perl script that I run from the command line, but I really want to run them by simply double clicking the file in the GUI.

I tried changing the extension to .command, but that didn't work.

Any suggestions?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
You can call them from an AppleScript which can then be double-clicked.

Code:
do shell script "/path/to/script.pl"

Then File > Save As, choose "Application bundle" for the File Format, and check Run Only.
 

iSee

macrumors 68040
Oct 25, 2004
3,540
272
Make sure the scripts are set as executable (i.e. "chmod +x somefile.pl" makes somefile.pl executable for everyone). That, plus giving them the .command extension works for me...

Also, you have the appropriate #!/.../perl line as the very first line of the script, right? (sorry, I can't quite remember what that line is supposed to be.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.