• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting 'Terminal'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting 'Terminal'


  • Subject: Re: Scripting 'Terminal'
  • From: Graff <email@hidden>
  • Date: Fri, 23 Jan 2004 00:22:21 -0500

You could always use the "do shell script" command that is part of Standard Additions. Look in the Standard Additions dictionary under "Miscellaneous Commands". Here is the text for the command:

do shell script: execute a shell script or command using the sh shell
do shell script plain text -- the command or shell script to execute. Examples are ls or /bin/ps -auxwww
[as type class] -- the desired type of result; default is Unicode text (UTF-8)
[administrator privileges boolean] -- execute the command as the administrator
[password plain text] -- use this administrator password to avoid a password dialog
[altering line endings boolean] -- change all line endings to Mac-style and trim a trailing one (default true)
[Result: plain text] -- the command output

For more in-depth information on this, see Apple's TechNote on it:
<http://developer.apple.com/technotes/tn2002/tn2065.html>

Be a bit cautious when you use this command. It runs the commands in a new instance of a shell (csh I believe) that doesn't have any of your normal shell variables set. If you read the TechNote it will explain it all to you.

Other than that you could script XCode, it has a very advanced dictionary that I'm sure can handle any kind of scripted compile you want to do. From the XCode page at Apple:
<http://www.apple.com/macosx/features/xcode/>
"All actions in Xcodes IDE are scriptable, letting you easily automate development processes and integrate custom build systems and other tools via Apple Events."

- Ken

On Jan 22, 2004, at 11:05 PM, James wrote:

Hello to all,
Has anyone had any success trying to pass arguments to a Terminal script.
From what I have noticed the Terminal's scriptability is minimal. To be more
persice, I am trying to have a script compile and run Objective-C code in the
terminal based on the filename the script is passed..
ex: scriptname progname.m
(and then Terminal would run 'gcc -o progname progname.m' then './progname'

And if Terminal is not capable of this script does anyone know of a terminal
like app that is. I am sure this is possible, I just think it might be above
me at my level of AppleScript knowledge.

Thank you,
Monty
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Scripting 'Terminal' (From: "James" <email@hidden>)

  • Prev by Date: Re: Checking for App running and restart if not
  • Next by Date: Re: [OT] Vote for Apple's "1984" as best Super Bowl commercial
  • Previous by thread: Scripting 'Terminal'
  • Next by thread: styled text to record, ok. But record to styled text?
  • Index(es):
    • Date
    • Thread