Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Toggle terminal transparency via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Toggle terminal transparency via AppleScript
Authored by: LincolnQ on Aug 13, '04 10:54:31AM

This seems like a particularly klugey way of doing it -- simulating input?

I would like to believe there is a better way.

Also, you say that it runs under tcsh. What does tcsh have to do with it? This is not a shell script, it's an applescript.



[ Reply to This | # ]
Toggle terminal transparency via AppleScript
Authored by: roncross@cox.net on Aug 13, '04 12:36:12PM

What does tcsh have to do with it?

I just put that in the hint because when I open my
Terminal, it defaults to a tcsh. In other words, what I am saying is that I did not test it under any other shell, therefore, to be safe, I just put the conditions under which it works for me. If it works with other shell, then I am all the more delighted. The script just opens a terminal; and I guess it will work for any shell. Thanks for clarifying this for me.

Please feel free to find a better way of doing it. Notice, that I am not making a claim that this is the best way to do it. I believe that there is probably a better way, but my experience limits me to applescript at this time.

thx
RLC

---
rlc



[ Reply to This | # ]
Toggle terminal transparency via AppleScript
Authored by: GregChant on Aug 13, '04 12:55:26PM

I've come up with a better way:


tell application "Terminal"
	activate
	tell window 1
		if background color is "white" then
			set background color to {0, 0, 0, -25000}
			set normal text color to "white"
		else
			set background color to "white"
			set normal text color to "black"
		end if
	end tell
end tell

This code will toggle between Black on White and White on Transparent Black. The -25000 refers to the transparency level: set it lower to increase the transparency (changing it by the thousands seems to make the only difference).

Caveats/"Features": The normal text color doesn't update until you start typing, and the text and the title bar gain shadows.



[ Reply to This | # ]