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

Script to run a command in new Terminal window works un-reliably.


  • Subject: Script to run a command in new Terminal window works un-reliably.
  • From: Andrei Tchijov <email@hidden>
  • Date: Thu, 27 Jul 2006 11:58:09 -0400

Hi,
  Could some one take a look at the script below and tell me what could be wrong with it?  The goal is to create new Terminal window and run a command in it.  The script works most of the time, but once in a while, it will fail to do "run command" bit.  

  Your comments will be highly appreciated.

  Very best regards,
Andrei Tchijov
Leaping Bytes, LLC

P.S. I am not sure if it make a difference, but I am running this script via the shell using osascript .
P.P.S. Though "activate" in the last "tell application ..." seems redundant, I think it did improve reliability of the script. 
===================================================================
tell application "System Events"
if not (exists process "Terminal") then
tell application "Terminal"
activate
end tell
else
tell application "Terminal"
activate
end tell
tell application "System Events"
tell process "Terminal"
tell menu bar 1
tell menu bar item "File"
tell menu "File"
click menu item "New Shell"
end tell
end tell
end tell
end tell
end tell
end if
tell application "Terminal"
activate
do script "<command to run>" in the front window
end tell
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

  • Follow-Ups:
    • Re: Script to run a command in new Terminal window works un-reliably.
      • From: Doug McNutt <email@hidden>
    • Re: Script to run a command in new Terminal window works un-reliably.
      • From: dev_sleidy <email@hidden>
    • Re: Script to run a command in new Terminal window works un-reliably.
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: Add prices with taxes in quark
  • Next by Date: Re: Script to run a command in new Terminal window works un-reliably.
  • Previous by thread: Re: Add prices with taxes in quark
  • Next by thread: Re: Script to run a command in new Terminal window works un-reliably.
  • Index(es):
    • Date
    • Thread