Re: Beginner's scripting Terminal questions
Re: Beginner's scripting Terminal questions
- Subject: Re: Beginner's scripting Terminal questions
- From: email@hidden (Jamie Kahn Genet)
- Date: Thu, 3 Mar 2005 04:16:54 +1300
Andrew Oliver <email@hidden> wrote:
> On 3/1/05 10:36 AM, "Jamie Kahn Genet" <email@hidden> wrote:
>
> > My trouble is as mentioned above: I don't get the full set of info in
> > the title bar either way and I lose transparency in the Terminal window
> > that opens. Can someone please tell me if there's a way to get my
> > desired results? Am I able to set window colours within the Terminal? If
> > so I'll just write a .command terminal script that includes them. Is
> > there a way?
>
>
> Despite the dictionary's implication that 'background color' takes a string
> parameter you can actually pass it a quartet of 0..65535 values indicating
> {R, G, B, Alpha} values:
>
> tell application "Terminal"
> set background color of window 1 to {65535, 65535, 65535, 0}
> end tell
>
> The above code creates a completely transparent window (actually, any value
> in the first three octets will do this since the alpha/transparency value is
> 0 meaning fully transparent).
>
> Passing 32767 as the alpha value will give a 50% transparent window, and any
> other value will give the corresponding level of transparency up to 65535
> which is fully opaque.
>
> You can also set the window title using its 'custom title' property:
>
> tell application "Terminal"
> set custom title of window 1 to "blah de blah de blah"
> end tell
>
> Andrew
> :)
Hi Andrew.
Thanks very much for the above info on how to specify the colour and
transparency of Terminal windows. Just what I needed, cheers :-)
However, your solution almost had me stumped as "set background color of
window 1 to {65535, 65535, 65535, 0}" caused an error, but "set
background color to {65535, 65535, 65535, 0}" worked. It took a little
while before I thought to check the syntax I was using previously when I
was only specifying simple names of colours, e.g. "black", "red".
Why does including "of window 1" break that line of the script?
Anyway, cheers again for that invaluable info Apple left out of the
Terminal's dictionary (or am I simply supposed to know that?). One last
question - do you know how to also include the particular Terminal
window's kb shortcut as can be set in the Terminal's Window Preferences?
Once again there's no info in the dictionary (but seeing as other info
has been left out I wondered nonetheless).
Regards,
Jamie Kahn Genet
P.S. Thanks also to those who suggested using saved .term files. But I
needed something that would work with the AS menu. Pity I can't put
anything but scripts in there.
--
If you're not part of the solution, you're part of the precipitate.
_______________________________________________
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