Re: Script to run a command in new Terminal window works un-reliably.
Re: Script to run a command in new Terminal window works un-reliably.
- Subject: Re: Script to run a command in new Terminal window works un-reliably.
- From: dev_sleidy <email@hidden>
- Date: Thu, 27 Jul 2006 16:19:59 -0400
Now I remember why I needed all that long long script :-(. It looks
like, your version will produce one extra empty Terminal window in
case when Terminal application was not running.
set tCommands to "osascript -e 'say \"Hallo Andrei\"'; cd /; ls -ls"
tell application "Terminal"
activate
if (not (exists front window)) then
-- Use either one of the two 'tell application "System Events" ...'
lines below.
--tell application "System Events" to tell process "Terminal" to
click menu item "New Shell" of menu "File" of menu bar item "File" of
menu bar 1
tell application "System Events" to tell process "Terminal" to
keystroke "n" using command down
delay 1 -- Adjust the delay value accordingly.
end if
do script tCommands in the front window
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden