-- Funktion für iTunes: langsam lauter werden on aufwachen(personal_playlist) tell application "iTunes" set sound volume to 0 if personal_playlist is not 0 then play playlist personal_playlist else play end if set u to sound volume repeat while u < 100 set u to u + 1 delay 0.1 set sound volume to u end repeat end tell end aufwachen -- Funktion für iTunes: langsam leiser werden on einschlafen() -- langsam leiser werden tell application "iTunes" set i to sound volume repeat while i ≥ 0 set sound volume to i set i to i - 1 delay 0.1 end repeat stop end tell end einschlafen -- Funktion: Sleep mode-Abfrage on sleepmode() display dialog "Nochmal hinlegen?" buttons {"Ja", "Nein, ich bin wach!"} default button 1 if the button returned of the result is "Ja" then tell application "iTunes" my einschlafen() end tell -- nochmal 5 Minuten (=300 Sekunden) länger schlafen, falls die "Enter"-Taste gedrückt wurde delay 300 tell application "iTunes" my aufwachen("Aufwachen") end tell my sleepmode() end if end sleepmode -- Script-Start: -- System Sound hochsetzen (von 0 bis 7 möglich) tell application "System Preferences" activate set current pane to pane "com.apple.preference.sound" set volume 4 tell application "System Preferences" to quit end tell -- iTunes starten tell application "iTunes" -- Eigene Liste namens "Aufwachen" öffnen und shuffle einstellen set shuffle of playlist "Aufwachen" to true my aufwachen("Aufwachen") my sleepmode() end tell
| 04.07.2022