Created
November 30, 2020 19:36
-
-
Save semicolonsnet/e8775b94367f68fd56ac5b6d115de84c to your computer and use it in GitHub Desktop.
A quick-and-easy AppleScript to 1) loop a background music file, and 2) fade that file out when a dialog button is pressed. I use this when presenting slide decks virtually.
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
tell application "QuickTime Player" | |
set theFile to open POSIX file "FILENAME HERE" | |
set audio volume of theFile to 0.3 | |
set looping of theFile to true | |
play theFile | |
end tell | |
display dialog "Music Control" buttons {"Fade"} | |
tell application "QuickTime Player" | |
repeat 30 times | |
set theValue to (audio volume of theFile) - 0.01 | |
set audio volume of theFile to theValue | |
delay 0.2 | |
end repeat | |
quit | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment