Mar 02, '10 07:30:00AM • Contributed by: nathanator11
Still not fine enough for you? AppleScript to the rescue, once again. Though it has some oddities, AppleScript can be used to set the volume based on an entered number.
Here's the first quirk: the number of squares filled in on the HUD will be twice the number you typed in. So, typing set volume 1 sets the volume to level two. (There are 16 squares total, so you can enter a number from 1 to 8). You can use decimals to set the volume by individual square, too: set volume .5 fills in one square. You can, amazingly, extend this functionality to even greater levels of precision.
Want to set the volume to three and one-fifth squares (i.e. 3.2)? Type set volume 1.6 and click Run. The number is doubled, and the volume is set. Two and one one-hundredth squares (2.01)? Type set volume 1.005. You can get as precise as you want, as you can see.
I wrote a script to first cut the entered number in half, then set the volume based on that value. Here it is:
display dialog ¬
"Enter number." with title ¬
"Number Of Squares?" buttons {"Set"} ¬
default button 1 default answer ""
set numberSquares to text returned of result
set numberHalved to numberSquares / 2
set volume numberHalved
[robg adds: This worked as described in 10.5 and 10.6.]
