I’ve recently moved my speakers to a wireless system through an AirPort Express which has been great expect for one thing, adjusting the volume!
In order to solve this problem I decided to write a simple AppleScript to change the volume within the iTunes application.
#Increase iTunes Volume
tell application "iTunes"
if it is running then
set curVol to the sound volume
if curVol < 100 then
set sound volume to curVol + 10
end if
end if
end tell
and…
#Decrease iTunes Volume
tell application "iTunes"
if it is running then
set curVol to the sound volume
if curVol > 10 then
set sound volume to curVol - 10
else
set sound volume to 0
end if
end if
end tell
If you want to do this for yourself simple download my iTunes Volume Scripts and save them to…
/Library/Scripts/iTunes Scripts
Then download and install FastScripts.
In order to make it easy and intuitive to use the scripts we’re going to map them to the F11 and F12 keys. (Basically the same keys you press for Volume Up/Down but you need to press Fn as well)
Go into System Preferences and disable the system defaults for Desktop and Dashboard.


Then go to the FastScripts preference pane.

There you will assign the scripts to run via Fn+F11 and Fn+F12 respectively.

Now you can easily change the volume of iTunes independently of the systems sound level.
Update
After rooting through some of the other scripts provided with the your Mac I noticed a volume adjustment Applescript. The script uses a scale of 16 volume levels rather than 100 so as to match the number of levels on the bezel HUD that appears you adjust the system volume.

So I just changed the older scripts to use this 16 level system and voila!
#Increase iTunes Volume
tell application "iTunes"
if it is running then
--Get the current output volume (on a scale from 1 to 100) and convert it to a scale from 1 to 16 as seen when using the volume keys
set currentVolume to the sound volume
set scaledVolume to round (currentVolume / (100 / 16))
--Use this code to increase the volume by a certain interval
set soundInterval to 1
set scaledVolume to scaledVolume + soundInterval
if (scaledVolume > 16) then
set scaledVolume to 16
end if
--After using one of the above, the volume needs to be set to the new level (before which we must convert it back to the 1..100 scale)
set newVolume to round (scaledVolume / 16 * 100)
set sound volume to newVolume
end if
end tell
#Decrease iTunes Volume
tell application "iTunes"
if it is running then
--Get the current output volume (on a scale from 1 to 100) and convert it to a scale from 1 to 16 as seen when using the volume keys
set currentVolume to the sound volume
set scaledVolume to round (currentVolume / (100 / 16))
set scaledVolume to scaledVolume - 1
if (scaledVolume < 0) then
set scaledVolume to 0
end if
--After using one of the above, the volume needs to be set to the new level (before which we must convert it back to the 1..100 scale)
set newVolume to round (scaledVolume / 16 * 100)
set sound volume to newVolume
end if
end tell
I also wrote another script to mute iTunes, which I then mapped to F10
# Mute iTunes
-- get the current mute setting
tell application "iTunes"
set isMuted to mute
-- invert it
set newMuted to not isMuted
-- and set it back
set mute to newMuted
end tell
I've updated the original .zip above to reflect the changes.