The code:
on action theObject
set lVolumeSlider to (integer value of slider theObject)
set lButtonState to (integer value of button "btn_Prefs_AudibleAlert" of tab view item "tab_Prefs_Other" of tab view "tab_View_Pref" of window "win_Preferences")
set lVolume to round lVolumeSlider rounding as taught in school -- To nearest whole number
if lButtonState = 1 then
set output volume to lVolume
beep
else
tell user defaults to set contents of default entry "mkp_vol_VolumeControl" to 0
end if
end action
The error:
The question:
Thinking that a slider would be a slick addition to the user interface I set about trying to script one, with frustrating results. In the above script “btn_Prefs_AudibleAlert” is a checkbox button indicating whether an audible alert is true or false and “mkp_vol_VolumeControl” is the user default value for the slider. What I am trying to do is set the application volume to the integer value of the slider but hopefully leave the system volume level where it is (ie: setting the volume in iTunes does not affect the overall volume of other applications). I have read several previous postings and tried several variations all to no avail.
Is there a simple answer to what I am doing wrong?
Thanks in advance.