Skip to content

Instantly share code, notes, and snippets.

@YungSang
Created February 23, 2013 12:37
Show Gist options
  • Save YungSang/5019611 to your computer and use it in GitHub Desktop.
Save YungSang/5019611 to your computer and use it in GitHub Desktop.
Volume Control for LoginHook and LogoutHook
set myPath to (path to me)
tell application "Finder"
set myFolder to (container of myPath) as string
end tell
set volumeScriptPath to myFolder & "volume.scpt"
set volumeScript to load script file volumeScriptPath
set volume (theVolume of volumeScript)
set myPath to (path to me)
tell application "Finder"
set myFolder to (container of myPath) as string
end tell
set volumeScriptPath to myFolder & "volume.scpt"
set volumeScript to load script file volumeScriptPath
set volumeGetUnit to 100 / 16
set volumeSetUnit to 7 / 16
set currentVolume to output volume of (get volume settings)
set (theVolume of volumeScript) to currentVolume / volumeGetUnit * volumeSetUnit
store script volumeScript in file volumeScriptPath with replacing
set volume volumeSetUnit * 1
property theVolume : 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment