Making a window transparent

I have been playing with the various properties of an applescript window to set the alpha level but nothing seems to work… I want it to be about 50% transparent. The properties that could be usefull are opaque of window and alpha level of window but alpha level doesn’t seem to work… can someone help?

tell window "target"
	set opaque to false
	set alpha value to 0.5
end tell

I’m not sure, but I think that “alpha value” must be a real number between 0 and 1.

Here’s a cool snippet to fade a window in or out:

Jon

The docs say that the value should be a short float or something… I was trying to use whole numbers less than 255 with decimal places… I didn’t think of values less than one… Thanx

:shock: This has got to be the coolest AppleScript Studio tip I’ve ever seen.
Works like a champ.

Thanks, it is cool. I’ve been running it over and over trying to think of a way to implement it that won’t be too cheesy.

Jon

Jonn I was wondering if you have gone anywhere with this yet. I was thinking of a simple app that windows would “fade out” when closed instead of collapsing or the gawdy “squashing windows”(I don’t know the term for those). So then, something like “Fade on close window”, and you could set the “Fade out” time in the preferences?
SC

I use a version of this code in my app Jon’s Phone Tool. You can see it in action when many of the windows are shown and hidden. I like it when displaying the dialpad, converter, & timer child windows attached to the main window.

Jon

Jon first posted this snippet at least a couple of years ago. I have used it, and variations of it ever since. I made a variation that would pass a number as well so that I could speed up or slow down the fade. In the repeat loops, replace the number 10 with the variable passed. It’s been awhile since I have played with it so I don’t remember the best ranges of numbers to use.

Thanks again Jon,
Brad Bumgarner, CTA