AppleScript: Set Display Brightness

I’ve been using AppleScript for years now, but I’ve never had the opportunity to become really good at it. I can do a few simple things, but once I get beyond that, I pretty much have to turn to the web. So it was, this morning: my office has two large windows in it, so the ambient light varies quite a bit from day to day and hour to hour. I finally decided that I’m sick and tired of adjusting the brightness on three different displays—not to mention hoping that they’re all exactly the same—on a regular basis. So as usual, I turned to the web. After a few less useful hits, I finally came to an old blog post called “ Change Monitor Brightness Using AppleScript .” It was exactly what I needed, with three exceptions: Since it’s four years old, it hasn’t been updated for Mountain Lion. It isn’t designed to change multiple displays concurrently. It doesn’t include the ability to specify the brightness level, on the fly. Having solved all three of these problems, I post my resu...