• 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: Terminal Scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminal Scripting


  • Subject: Re: Terminal Scripting
  • From: Graff <email@hidden>
  • Date: Fri, 27 Feb 2004 23:21:53 -0500

On Feb 27, 2004, at 8:04 PM, Martin Orpen wrote:

on 28/2/04 12:34 am, Graff at email@hidden wrote:

Ok, because Terminal doesn't seem to support the standard suite of
AppleScript commands I found myself unable to create new windows within
it. I have found a workaround however. Just run an empty script, that
will cause a window to open in front of all other windows:
do script ""

Are we using different versions of Terminal?

Terminal produces a new window every time you send a command:

tell application "Terminal"
activate
do script "find . -name '*.scpt' -print"
end tell

Opens a new window every time on my Mac - and finds the scripts I thought
I'd lost :-)

Yes, it opens a window. However I had several problems. For example:

This script will call up 2 windows, not one window with 2 commands.
----------------
tell application "Terminal"
do script "cd ~/Desktop/"
do script "ls -l"
end tell
----------------


This script does "ls -l" first and then does "cd ~/Desktop/", all in one window:
----------------
tell application "Terminal"
do script "cd ~/Desktop/"
do script "ls -l" in front window
end tell
----------------


This script gives an error of "Terminal got an error: NSArgumentEvaluationScriptError" if there are no windows open in Terminal before it is run:
----------------
tell application "Terminal"
do script "cd ~/Desktop/" in front window
do script "ls -l" in front window
end tell
----------------


This script works perfectly:
----------------
tell application "Terminal"
do script ""
do script "cd ~/Desktop/" in front window
do script "ls -l" in front window
end tell
----------------


And so that's why I wrote it that way!

- Ken
_______________________________________________
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.


  • Follow-Ups:
    • Re: Terminal Scripting
      • From: Martin Orpen <email@hidden>
    • Re: Terminal Scripting
      • From: Graff <email@hidden>
References: 
 >Re: Terminal Scripting (From: Martin Orpen <email@hidden>)

  • Prev by Date: Re: moot [was: AS/FMP: a list of fewer than two records]
  • Next by Date: Re: Terminal Scripting
  • Previous by thread: Re: Terminal Scripting
  • Next by thread: Re: Terminal Scripting
  • Index(es):
    • Date
    • Thread