[AppleScript] 纯文本查看 复制代码
global f1, f2, f3, f4
on run
set f1 to "/System/Library/Sounds/Pop.aiff"
set f2 to "/System/Library/Sounds/Ping.aiff"
set f3 to "/System/Library/Sounds/Glass.aiff"
set f4 to "/System/Library/Sounds/Tink.aiff"
end run
on idle
set {hours:h, minutes:m, seconds:s} to current date
if (h = 6) and (m = 30) and (s = 0) then --6:30 起床
OnAlert(f1, f4, f3, "06:30 了,快点起床。", "起床提醒.", "Hurry up , it's time to get up")
else if (h = 10) and (m = 0) and (s = 0) then --10 运动
OnAlert(f1, f4, f3, "10:00 了,新一轮的健身开始了", "健身提醒.", "start a new round of fitness")
else if (h = 12) and (m = 0) and (s = 0) then --午餐,休息,运动
OnAlert(f1, f4, f3, "12:00 了,可以准备午餐了", "午餐提醒.", "Let's prepare lunch.")
else if (h = 14) and (m = 0) and (s = 0) then --下午学习
OnAlert(f1, f4, f3, "14:00 了,午后学习开始了", "学习提醒.", "Let's start our afternoon study.")
else if (h = 17) and (m = 30) and (s = 0) then --17:30 晚餐,休息
OnAlert(f1, f4, f3, "17:30 了,可以准备晚餐了", "晚餐提醒.", "Let's prepare dinner.")
else if (h = 19) and (m = 0) and (s = 0) then --学习
OnAlert(f1, f4, f3, " 19:00 了,晚上学习开始了。 ", "学习提醒.", "Let's begin our everning study.")
else if (h = 21) and (m = 0) and (s = 0) then --运动
OnAlert(f1, f4, f3, " 21:00 了,最后一次健身运动开始了。 ", "健身提醒.", "Let's start the final fitness.!")
else if (h > 23) and (m = 0) and (s = 0) then
display dialog "很晚了,睡觉吧。身体是革命的本钱,不要过度浪费啊。"
--exit repeat
end if
return 0.5
end idle
on OnAlert(sound1, sound2, sound3, content, sub, sayText)
repeat with i from 1 to 5
do shell script "afplay " & sound1
do shell script "afplay " & sound2
end repeat
do shell script "afplay " & sound3
display notification content with title "日程表" subtitle sub sound name "Ping"
say sayText
end OnAlert