(Tip)
This is the Applescript that I used though - allows you to change the time instead of changing the script each time you need to:
tell application "iTunes"
display dialog "Set sleep timer in minutes or hours?" buttons {"Minutes", "Hours"} default button 1
if button returned of the result is "Minutes" then
display dialog "Set sleep time:" buttons {"OK", "Cancel"} default button 1 default answer ""
set x to (text returned of the result) * 60
delay x
quit
else
if button returned of the result is "Hours" then
display dialog "Set sleep time:" buttons {"OK","Cancel"} default button 1 default answer ""
set y to (text returned of the result) * 3600
delay y
quit
end if
end if
end tell
This is the Applescript that I used though - allows you to change the time instead of changing the script each time you need to:
tell application "iTunes"
display dialog "Set sleep timer in minutes or hours?" buttons {"Minutes", "Hours"} default button 1
if button returned of the result is "Minutes" then
display dialog "Set sleep time:" buttons {"OK", "Cancel"} default button 1 default answer ""
set x to (text returned of the result) * 60
delay x
quit
else
if button returned of the result is "Hours" then
display dialog "Set sleep time:" buttons {"OK","Cancel"} default button 1 default answer ""
set y to (text returned of the result) * 3600
delay y
quit
end if
end if
end tell