I'm trying to replicate the function of the volume keys, but in applescript. I can't get it to work though. The increase volume button puts the volume at max and the decrease volume button does the same. Anyone know what i'm doing wrong? Heres my code:
-- increase volume
on increaseVolumeHandler_(sender)
tell application "finder"
set theOutput to output volume of (get volume settings)
set volume output volume (theOutput + 6.25)
end tell
do shell script "afplay /System/Library/Sounds/Pop.aiff"
end increaseVolumeHandler_
-- decrease volume
on decreaseVolumeHandler_(sender)
tell application "finder"
set theOutput to output volume of (get volume settings)
set volume output volume (theOutput - 6.25)
end tell
do shell script "afplay /System/Library/Sounds/Pop.aiff"
end decreaseVolumeHandler_