• 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: Re: Odd behavior scripting Terminal's default window (Digest, V.2, #83)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Odd behavior scripting Terminal's default window (Digest, V.2, #83)


  • Subject: Re: Re: Odd behavior scripting Terminal's default window (Digest, V.2, #83)
  • From: "Jonathan Levi, M.D." <email@hidden>
  • Date: Fri, 4 Feb 2005 13:41:07 -0500

On Thu, 03 Feb 2005 22:45:32 -0700, Gnarlodious <email@hidden> wrote:
Entity Christopher Biagini spoke thus:

 It seems that when Terminal starts it can't set the window title for
 the default window.
How about this? Quit Terminal, then...

tell application "Terminal"
> set custom title of window 1 to "Applescript result"
 do script "echo 'Terminal launched'" in window 1
 end tell

Yes, that works! But it turns out that Terminal is finicky about window names WRT its "Windows settings" preferences. In fact, it looks like the script actually sets the default window title to "Applescript result" when that window is in front.

I tried a slightly different solution. Notice the title (per System Events) that the window actually got, instead of "Applescript result":


tell application "Terminal"
--activate as desired
if (count windows) = 0 then --if Terminal's running but has no windows
do script "echo -n"
delay 1
end if
set custom title of last window to "AppleScript Result"
do script "echo Terminal launched" in last window
set cw to item 1 of (windows whose name starts with "AppleScript Result")
do script "echo terminal called again" in cw
end tell


tell application "System Events" to tell process "Terminal"
	name of menu items of menu "Window" of menu bar 1
end tell

--result: {"Minimize", "Zoom", "-", "Return To Default Size", "-", "Next Terminal", "Previous Terminal", "-", "Bring All to Front", "-", "AppleScript Result - bash"}
_______________________________________________
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
  • Prev by Date: Re: command line ZIPping UNZIPping syntax
  • Next by Date: Re: command line ZIPping UNZIPping syntax
  • Previous by thread: Re: running a script again
  • Next by thread: QuarkXPress 6.5 Scripting Strategy Question
  • Index(es):
    • Date
    • Thread