Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Archive > Archives of Old Posts > Mac Help/Tips (archive)
TouchArcade.com - iPhone Game Reviews and News

 
 
Thread Tools Search this Thread Display Modes
Old Jul 23, 2003, 08:29 PM   #1
DeadlyBreakfast
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 is offline  
Old Jul 23, 2003, 08:52 PM   #2
scan300
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
scan300 is offline  
Old Jul 23, 2003, 09:44 PM   #3
DeadlyBreakfast
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 is offline  
Old Jul 23, 2003, 10:09 PM   #4
DeadlyBreakfast
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 is offline  
Old Jul 23, 2003, 10:42 PM   #5
Doctor Q
macrumors god
 
Doctor Q's Avatar
 
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
Doctor Q is offline  

 

Mac Forums > Archive > Archives of Old Posts > Mac Help/Tips (archive)

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:50 AM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC