• 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: Script to run a command in new Terminal window works un-reliably.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Script to run a command in new Terminal window works un-reliably. (From: Andrei Tchijov <email@hidden>)
 >Re: Script to run a command in new Terminal window works un-reliably. (From: Andrew Oliver <email@hidden>)
 >Re: Script to run a command in new Terminal window works un-reliably. (From: Andrei Tchijov <email@hidden>)
 >Re: Script to run a command in new Terminal window works un-reliably. (From: Andrei Tchijov <email@hidden>)

  • Prev by Date: Re: Script to run a command in new Terminal window works un-reliably.
  • Next by Date: getting file info
  • Previous by thread: Re: Script to run a command in new Terminal window works un-reliably.
  • Next by thread: Fwd: Script to run a command in new Terminal window works un-reliably.
  • Index(es):
    • Date
    • Thread