Created
February 23, 2013 12:37
-
-
Save YungSang/5019611 to your computer and use it in GitHub Desktop.
Volume Control for LoginHook and LogoutHook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property theVolume : 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment