Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > scripting the terminal

scripting the terminal
Thread Tools
Forum Regular
Join Date: Sep 2000
Location: Seattle, WA
Status: Offline
Reply With Quote
Mar 13, 2002, 11:45 AM
 
I've never used AppleScript before, but i need to create some scripts that control terminal.app

What is the general format of a script that would execute a terminal command?
Anthony Wu
- - - - - - - - - -
Titanium PowerBook G4/550 - X 10.2
Beige PowerMac G3/500 - X 10.1
HP 751n P4/1.8GHz - XP Pro SP1
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Mar 13, 2002, 09:52 PM
 
Originally posted by yuliang:
<STRONG>I've never used AppleScript before, but i need to create some scripts that control terminal.app

What is the general format of a script that would execute a terminal command?</STRONG>
The direct answer to your question would be:

<font color = red>tell</font> <font color = blue>application</font> "Terminal"
    <font color = blue>do script with command</font> "ls /"
<font color = red>end tell</font>

However, I would use the do shell script command which doesn't have you use the Terminal:

<font color = blue>do shell script "ls /"</font>

HTH
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:19 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2