Something is occurring in my ASObjC app that I was not expecting.
I’m calling a handler from another handler, the first of which has the line at the end…
my performSelector:"runningLoop:" withObject:(missing value) afterDelay:mailManagerDelay
I expected the first handler to terminate at the last line, but instead it’s bouncing back to the line that’s calling the first handler, and progressing past the line that I expected to call a terminated handler.
The two handlers are below. I obviously don’t understand why the first handler is returning to the second. Could someone tell me if it’s possible to terminate the ‘return’ from the first handler, please, and how?
on runningLoopInitializer()
try
set p to 1
my fordEvent()
#
-- This routine gets Universal Time
set p to 2
set my resetSelector to false
set p to 3
if my interarchyActivator and ((current date) - (my ftpWatcherCaller) > 60) then
set my ftpWatcherCaller to current date
tell application "Finder"
try
set theCurrentState to read file (pathToDesktop & "ftp Downloads:AllTheftpData.dat" as text) as text
if (count of theCurrentState) > 0 then
try
if not (exists process "ftp Watcher") then tell application ":Applications:Mail Manager:ftp Watcher.app" to activate
end try
end if
end try
end tell
end if
on error errmsg
tell application "System Events" to display dialog "runningLoopInitializer error " & errmsg & " p = " & p
end try
my performSelector:"runningLoop:" withObject:(missing value) afterDelay:mailManagerDelay
end runningLoopInitializer
on endingLoopSix()
try
set p to 0
try
tell application "Finder"
if runForOz then my sayTheText:("1")
set theProcesses to name of processes as list
end tell
if "Mail Manager Loop Runner" is in theProcesses or "Mail Manager Item Printer" is in theProcesses then
say "true"
set my itemPrinterIsActuallyRunning to true
my runningLoopInitializer()
say 8 # The first handler is returning to here, which I did not expect. Why?
else
say "false"
end if