이 AppleScript 유휴 타이머가 올바르게 실행되지 않는 이유는 무엇입니까?
특정 시간 (이 경우 시간이 xx : 03 : 24 일 때마다)으로 증가하는 타이머를 만들고 사용자가 입력 한 값에 도달하면 알림을 보냅니다. 일단 이렇게하면 증분을 재설정하고 수동으로 종료 할 때까지 반복합니다.
그러나이 코드는 가정 할 때 안정적으로 트리거되지 않습니다. 왜 누군가는 추측을합니까?
on quit
continue quit
end quit
tell application "Notifications Scripting"
set event handlers script path to (path to me)
end tell
global actions, newActions
using terms from application "Notifications Scripting"
on notification activated
tell application "Safari"
activate
set winlist to every window
repeat with win in winlist
set numtabs to 0
try
set tablist to every tab of win
set numtabs to length of tablist
end try
if numtabs is greater than 0 then
repeat with t in tablist
if "fallenlondon.storynexus.com" is in (URL of t as string) then
tell application "System Events"
tell window id (id of win as integer) of application "Safari" to set current tab to tab (index of t as integer)
end tell
end if
end repeat
end if
end repeat
end tell
end notification activated
end using terms from
display dialog "How many actions do you want to build up before being notified?" default answer "1"
set actions to (text returned of result) as number
set newActions to 0
on idle
if ((seconds of (current date)) = 24) and ((minutes of (current date)) mod 10 = 3) then
set newActions to (newActions + 1)
set delayTime to 540
else
set delayTime to 0.5
end if
if newActions ≥ actions then
if newActions = 1 then
tell application "Notifications Scripting" to display notification "Fallen London" message "You have " & newActions & " new action!" sound name "Glass"
else
tell application "Notifications Scripting" to display notification "Fallen London" message "You have " & newActions & " new actions!" sound name "Glass"
end if
set newActions to 0
end if
return delayTime
end idle
트리거시기에 대해 자세히 알려주십시오. 트리거링은 일관성이 있습니까? – SunSparc