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

DeadlyBreakfast

macrumors regular
Original poster
Ok, So im playing around with Perl. Ive made a quick little proggie. No problem. My question is , is there anyway to make an alias that will start the terminal then start the program for me?
Thanks!!
 
Applescript can launch an app for you and run UNIX line commands using the "do script" command.

eg
Code:
tell application "Terminal"
activate
do script (your commands here)
end tell
 
Ok that got me most of the way, I just need to figure out how to cd to my perl directory then execute the "perl conversion" command.

Thanks!!
 
If you want to use a sequence of Terminal commands, you can put them in a shell script file (e.g., file /Users/myname/myscript), give the file execute permission (with the command chmod ugo+x /Users/myname/myscript), and then have AppleScript invoke the script rather than invoking a single Terminal command.

--- Example ---

Applescript:
tell application "Terminal" to do script "/Users/myname/myscript"

File /Users/myname/myscript:
#! /bin/sh
cd /Users/myname/perlstuff
...perl conversion command...
...other commands...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.