|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
macrumors regular
Join Date: Aug 2002
Location: In a dark corner somewhere. Help me..
|
Perl question / Alias question
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!!
__________________
If at first you don't succeed... You must be running Windows... |
|
|
| DeadlyBreakfast |
| View Public Profile |
| Find More Posts by DeadlyBreakfast |
|
|
#2 |
|
macrumors regular
Join Date: Mar 2003
Location: Melbourne, Australia
|
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 |
|
|
|
|
#3 |
|
Thread Starter
macrumors regular
Join Date: Aug 2002
Location: In a dark corner somewhere. Help me..
|
Great!! Ill try it out ..Thanks!!
__________________
If at first you don't succeed... You must be running Windows... |
|
|
| DeadlyBreakfast |
| View Public Profile |
| Find More Posts by DeadlyBreakfast |
|
|
#4 |
|
Thread Starter
macrumors regular
Join Date: Aug 2002
Location: In a dark corner somewhere. Help me..
|
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 at first you don't succeed... You must be running Windows... |
|
|
| DeadlyBreakfast |
| View Public Profile |
| Find More Posts by DeadlyBreakfast |
|
|
#5 |
|
macrumors god
Join Date: Sep 2002
Location: at the table with countless relatives
|
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...
__________________
"You've just been abducted, of course you need crepes!" -- Walter Bishop |
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|