• 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: New window in Terminal.app(Applescript-users Digest, Vol 2, Issue 67)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New window in Terminal.app(Applescript-users Digest, Vol 2, Issue 67)


  • Subject: Re: New window in Terminal.app(Applescript-users Digest, Vol 2, Issue 67)
  • From: "Jonathan Levi, M.D." <email@hidden>
  • Date: Sun, 30 Jan 2005 11:38:56 -0500


On Sat, 29 Jan 2005 09:23:10 -0700, Doug McNutt <email@hidden> wrote:
At 16:10 +0100 1/29/05, wayne melrose wrote:
tell app "terminal"
do script "myscript" -- opens a new window
do script "mysecondscriptline" in front window -- does the second line in the same window as the first line
end tell

Wayne, thanks for pointing out the "in front window" clause.

On Jan 29, 2005, at 3:56 PM, Gnarlodious wrote:

When Terminal is NOT open and I use this command it then opens TWO windows.
Is there a way to force it to operate on the window it already opened?

If you want to use the default window when Terminal isn't already running, but use a new window otherwise (i.e., not to write into a Terminal window already being used for something else), you could use System Events as a probe without causing Terminal to open a new window, e.g.,


ttell application "System Events" to set terminalOn to (exists process "Terminal")
if (terminalOn) then
tell application "Terminal" to do script "date"
else
tell application "Terminal" to do script "date" in front window
end if


Jonathan

_______________________________________________
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: New window in Terminal.app(Applescript-users Digest, Vol 2, Issue 67)
      • From: Gnarlodious <email@hidden>
  • Prev by Date: Re: sending Apple events between users (Pause iTunes of different user, redux)
  • Next by Date: [ANN] iMagine Photo updated - now free
  • Previous by thread: Re: sending Apple events between users (Pause iTunes of different user, redux)
  • Next by thread: Re: New window in Terminal.app(Applescript-users Digest, Vol 2, Issue 67)
  • Index(es):
    • Date
    • Thread