Le 2 sept. 2009 à 17:11:13, Robert Poland a écrit :
set WakeUpTime to "6:01"
set SleepTime to "21:01"
set nowTime to (current date)
set wakeTime to date (date string of nowTime & ":" & WakeUpTime) -- NOTE use of ":"
set bedTime to date (date string of nowTime & ":" & SleepTime) -- NOTE use of ": "
display dialog nowTime & return & bedTime & return & wakeTime as string
if (nowTime is less than bedTime) and (nowTime is greater than wakeTime) then
display dialog "You should be awake"
end if
Isn't it what is covered by the contents of page 13 in the RN-Applescript.PDF ?set WakeUpTime to (1 + (6 * 60)) * minutes
set SleepTime to (1 + (21 * 60)) * minutes
set nowTime to (current date)
set wakeTime to (current date)
set time of wakeTime to WakeUpTime
set bedTime to (current date)
set time of bedTime to SleepTime
display dialog nowTime & return & bedTime & return & wakeTime as string
if (nowTime is less than bedTime) and (nowTime is greater than wakeTime) then
display dialog "You should be awake"
end if
Yvan KOENIG (VALLAURIS, France) mercredi 2 septembre 2009 17:31:31