DATE
Current Date

Date
COMMENT
自动闹钟 v1.11.1 (只支持 iOS 17 / iPadOS 17 / watchOS 10 以上系统)
⚠️ 初次配置或者修改闹钟后务必手动运行一次此快捷指令,然后在自动化中添加每天凌晨定时运行。详情及问题反馈请访问:https://jankan.com/709.html。
⬇️ 初始配置文件
DICTIONARY

Dictionary
COMMENT
⬇ 工作日闹钟列表
时间格式是24小时制 HH:mm
正确时间范围:00:00 - 23:59
⚠️ 确保时间格式正确,如果是错误的时间格式,将忽略创建错误时间的闹钟。
✅ 正确示范: 00:00 08:30 23:59
❌ 错误示范: 24:00 8:30 23:60
LIST

List
COMMENT
⬇️ 休息日闹钟列表
⚠️ 确保时间格式正确,格式规则同上。错误或留空将不创建此闹钟。
LIST

List
COMMENT
⬇️ 休息日列表
添加你个人的休息日,格式: 周一, 周二, 周三, 周四, 周五, 周六, 周日
⚠️ 顺序可以交错,错误格式将忽略,清空后此快捷指令将无休息日
LIST

List
COMMENT
⬇️ 节假日调休开关
True 打开 / 有节假日调休
False 关闭 / 无节假日调休
DICTIONARY

Dictionary
COMMENT
⬇️ 个人日历关键字,优先权最大 —> v1.91 新增
根据个人日历设定的关键字控制闹钟,可修改
第一行 personalWorkingKeyword 个人日历工作日关键字
第二行 personalOffdayKeyword 个人日历休息日关键字
DICTIONARY

Dictionary
COMMENT
⬇️ 就寝/睡眠闹钟 控制开关 —> v1.10.0 新增,默认关闭
True 打开 就寝/睡眠闹钟 控制
False 关闭 就寝/睡眠闹钟 控制
⚠️ 打开前请先在系统的健康app中设置好就寝/睡眠闹钟。
DICTIONARY

Dictionary
COMMENT
⬇️ 检查更新开关 —> v1.9.2 新增
True 打开检查更新
False 关闭检查更新
DICTIONARY

Dictionary
COMMENT
获取输入的时间/休息日/节假日调休以及初始配置
VARIABLES
Set variable
config
to
词典
VARIABLES
Set variable
workingTimeInput
to
列表
VARIABLES
Set variable
offdayTimeInput
to
列表
VARIABLES
Set variable
offdaySelect
to
列表
TEXT
词典

Text
VARIABLES
Set variable
holidaySwitch
to
文本
VARIABLES
Set variable
name
to
config
VARIABLES
Set variable
version
to
config
VARIABLES
Set variable
workingPrefix
to
config
VARIABLES
Set variable
offdayPrefix
to
config
VARIABLES
Set variable
path
to
config
VARIABLES
Set variable
site
to
config
TEXT
词典

Text
VARIABLES
Set variable
sleepAlarm
to
文本
TEXT
词典

Text
VARIABLES
Set variable
updateCheck
to
文本
VARIABLES
Set variable
workingKeyword
to
config
VARIABLES
Set variable
offdayKeyword
to
config
VARIABLES
Set variable
personalWorkingKeyword
to
personalWorkingKeyword
VARIABLES
Set variable
personalOffdayKeyword
to
personalOffdayKeyword
COMMENT
校验输入的时间格式和休息日格式
v1.7 新增对闹钟列表错误时间的具体提示,以通知方式出现,防止因错误的时间格式导致自动化运行卡住。
v1.72 新增休息日错误提示。
v1.73 在没有错误的情况下,不遍历时间及休息日列表,提升运行效率。
VARIABLES
Add
workingTimeInput
to
inputArray
TEXT
Match
(?:[01]\d|2[0-3]):[0-5]\d
in
workingTimeInput

Matches
VARIABLES
Set variable
workingTimeRight
to
匹配
VARIABLES
Add
匹配
to
rightArray
VARIABLES
Add
offdayTimeInput
to
inputArray
TEXT
Match
(?:[01]\d|2[0-3]):[0-5]\d
in
offdayTimeInput

Matches
VARIABLES
Set variable
offdayTimeRight
to
匹配
VARIABLES
Add
匹配
to
rightArray
VARIABLES
Add
offdaySelect
to
inputArray
TEXT
Match
周[一二三四五六日]
in
offdaySelect

Matches
VARIABLES
Add
匹配
to
rightArray
SCRIPTING
Count
Items
in
inputArray

Count
SCRIPTING
Count
Items
in
rightArray

Count
SCRIPTING
If
数量
is not
数量
TEXT
匹配

Text
SCRIPTING
Repeat with each item in
workingTimeInput

Repeat Results
SCRIPTING
If
文本
does not contain
Repeat Item
TEXT
工作日闹钟/第
Repeat Item
项
Repeat Index
✖️ 时间格式错误

Text
VARIABLES
Add
文本
to
workingTimeError
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
TEXT
匹配

Text
SCRIPTING
Repeat with each item in
offdayTimeInput

Repeat Results
SCRIPTING
If
文本
does not contain
Repeat Item
TEXT
休息日闹钟/第
Repeat Item
项
Repeat Index
✖️ 时间格式错误

Text
VARIABLES
Add
文本
to
offdayTimeError
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
TEXT
匹配

Text
SCRIPTING
Repeat with each item in
offdaySelect

Repeat Results
SCRIPTING
If
文本
does not contain
Repeat Item
TEXT
休息日/第
Repeat Index
项
Repeat Item
✖️ 格式错误

Text
VARIABLES
Add
文本
to
offdaySelectError
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
VARIABLES
Add
workingTimeError
to
allError
VARIABLES
Add
offdayTimeError
to
allError
VARIABLES
Add
offdaySelectError
to
allError
TEXT
allError
请按格式重新填写

Text
NOTIFICATIONS
Show notification
文本
Options Under Construction
SCRIPTING
Otherwise
NOTHING
Nothing
SCRIPTING
End If

If Result
COMMENT
无任何有效时间和周期提醒
SCRIPTING
If
sleepAlarm
contains
false
SCRIPTING
If
rightArray
does not have any value
SCRIPTING
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
VARIABLES
Set variable
workingList
to
workingTimeRight
VARIABLES
Set variable
offdayList
to
offdayTimeRight
COMMENT
准备文件
DOCUMENTS

File
VARIABLES
Set variable
getFile
to
文件
SCRIPTING
Get dictionary from
getFile

Dictionary
VARIABLES
Set variable
exitingConfig
to
词典
SCRIPTING
If
getFile
does not have any value
NUMBER
1

Number
VARIABLES
Set variable
actionCount
to
数字
SCRIPTING
Otherwise