Je ne connais pas trop AppleScript, mais, avec quelques tests, j'ai fait ça
set timeStr to time string of (current date)
set Pos to offset of ":" in timeStr
set theHour to characters 1 thru (Pos - 1) of timeStr as string
set timeStr to characters (Pos + 1) through end of timeStr as string
set Pos to offset of ":" in timeStr
set theMin to characters 1 thru (Pos - 1) of timeStr as string
set timeStr to characters (Pos + 1) through end of timeStr as string
set Pos to offset of " " in timeStr
set theSfx to characters (Pos + 1) through end of timeStr as string
set theHourenChn to theHour as string
display dialog "timeStr = " & timeStr & " • Longueur de theHour = " & (length of theHour) & " • theHour = " & theHour as string
display dialog "time of (current date) = " & (time of (current date)) as string
if theHourenChn is "16" then
display dialog "C'est l'heure. Au revoir."
tell application "TextEdit" to quit
end if
qui semble fonctionner, qui quitte le programme cité si une certaine heure est en cours.
Ça demande confirmation si des modifications n'ont pas été enregistrées.
--