property Reveillie : alias "MacBook Pro:Users:sjc:Documents:Development:cron:Reveille.mp3"
property sysVolMax : 100
property qtVolMax : 256
property reveilleVol : 30 -- reduce to 10 for external speakers
property logfile : "MacBook Pro:Users:sjc:Documents:Development:cron:Debug Log.txt"
try
set logFileID to open for access file logfile with write permission
on error
close access file logfile
return
end try
write ¬
return & "Start at: " & (current date) & return & return to logFileID ¬
starting at get eof of logFileID
-- Set System Volume
set pctVol to reveilleVol / sysVolMax
set saveSysVol to output volume of (get volume settings)
display dialog "Current System Volume is " & saveSysVol
write ¬
"System Volume = : " & saveSysVol & return to logFileID ¬
starting at get eof of logFileID
set volume output volume pctVol * sysVolMax
set newSysVol to output volume of (get volume settings)
display dialog "New System Volume is " & newSysVol
tell application "QuickTime Player"
activate
set theFile to open Reveillie
set audio volume of document 1 to pctVol * qtVolMax
play document 1
repeat while playing of document 1
delay 1
end repeat
-- display dialog "quitting"
quit
end tell
-- Restore System Volume Settings
set volume output volume saveSysVol
write ¬
"Stop at: " & (current date) & return & return to logFileID
close access logFileID