Re: New window in Terminal.app(Applescript-users Digest, Vol 2, Issue 67)
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