RE: New window in Terminal.app
RE: New window in Terminal.app
- Subject: RE: New window in Terminal.app
- From: Doug McNutt <email@hidden>
- Date: Fri, 28 Jan 2005 13:20:48 -0700
At 13:23 +0000 1/28/05, John M wrote:
>tell application "Terminal"
> do script ""
>end tell
Thank you and Bill. It works but. . . I'm still not outta the woods. OS 10.7.3
The osascript commands below are being run from a BBEdit worksheet.
osascript -e 'tell application "Terminal" to do script ""' # Open a window
# works fine opening a new window in the front which it names "tcsh".
osascript -e 'tell application "Terminal" to set name of front window to "GeeWhiz"' # Name it
# Also works fine and the name/title changes on the screen
osascript -e 'tell application "Terminal" to get name of front window'
GeeWhiz
# returns the name as I expect.
osascript -e 'tell application "Terminal" to do script "date" in window "GeeWhiz"'
# Prints the date in the new window as I expect.
osascript -e 'tell application "Terminal" to get name of front window'
tcsh
$ Huh?? The name of the window has reverted to its original "tcsh". And it shows that way in the title bar. I have lots more I want to do in that window and it may not remain frontmost.
osascript -e 'tell application "Terminal" to do script "something useful" in window "GeeWhiz"'
# Fails with obscure message which surely means that the named window doesn't exist.
Is this purposeful behavior or should I file a bug report?
I need a window selection scheme that will allow stored (shell) scripts to run properly without having to tell them, each time, which Terminal window to address. Trying to set index of front window fails (index is NOT identified as [r/o].) The index numbers seem always to call the front window "1" so I can't just get the index and save it.
# An interesting side note . . .
# With a single window open in Terminal:
osascript -e 'tell window 1 of application "Terminal" to do script "date"'
# Causes Terminal to create a second window in which it shows the date!
As Bill Briggs says:
> But isn't it just amazingly lame that you can't get one the "normal" way?
>"make new window" just isn't cryptic enough, I guess.
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
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