Part of handler
if my serverBackupState and my attachmentCounter = 0 then
try
tell application "Finder" to set my dailyServerFolder to (my serverFolder & ":" & ("Yearly Email Storage " & my theYear as text) & ":" & (my theAddedMonth) & ":" & (my dailyName) as text)
on error errmsg number errnum
if my runForOz or errnum = 1 then tell application "System Events" to display dialog "Mail Manager Loop Runner setupPrintCoverPage setting dailyServerFolder folder. The Server may not be available. Error " & errmsg & " error number " & errnum & " p = " & p giving up after 10
end try
set p to 10
try
do shell script "mkdir -p " & quoted form of POSIX path of (my dailyServerFolder as text)
on error errmsg number errnum
if my runForOz then say "calling sound” —< says this
set my soundCounter to 3
theSound's play() —< plays once
Called from next handler
if my runForOz then say "calling sound” —< says this
set my soundCounter to 3
theSound's play() — < doesn’t play
On 2 Oct 2015, at 2:34 pm, Shane Stanley <
email@hidden> wrote:
Try to avoid loops with delays in them where possible.
property soundCounter : 0
on applicationWillFinishLaunching:aNotification
set theSound to current application's NSSound's soundNamed:"Glass"
theSound's setDelegate:me
set my soundCounter to 4
theSound's play()
end applicationWillFinishLaunching:
on |sound|:theSound didFinishPlaying:someBool
set soundCount to my soundCounter
set my soundCounter to soundCount - 1
if soundCount > 0 then
theSound's play()
else
my initializingRoutineTwo()
end if
end |sound|:didFinishPlaying: