Re: Terminal Scripting
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.