G’day scripters.
I’ve struck two problems with the running of my split-up large Application.
The first is that I’m trying to call the main processing loop every 4 seconds, from a small handler (runningLoopCaller), that most other handlers return to after they’re finished. However, the small handler is calling the main loop as quick as it can, without the 4 second delay.
Whilst I realise this procedure is not following Shanes Explored method example in which a handler calls itself, I’m wondering if this should work or not? It works at 4 seconds until the small handler is called by another handler, then the loops become very fast.
on runningLoopCaller() performSelector_withObject_afterDelay_(“runningLoop", missing value, 4) end runningLoopCaller
on runningLoop() try if my runForOz then say 0 # many lines of code calling different handlers, some of which call two other script objects, and three other secondary apps, some of which call ‘runningLoopCaller’ when finished. my runningLoopCaller() end runningLoop
The second is that the main script is split into three script objects, but it seems that the first main script can continue running whilst the other script objects are active. I sort of expected that only one script could run at once, but the main loop (my runningLoop) in the main script continues to loop while my actual mail printing loop is running, causing all sorts of problems. My question is, just to double check, can more that one grouped script objects work together at once?
If they can work together, how can I isolate each script until it’s finished? I’ve set variables to activate when a script object is working, but it’s difficult to allow the scripts to finish what they’re trying to do. For example, my Mailer script object prints emails with received email details, and adds ’Numbers’ charts to the eMails. However the main script while cycling interrupts this, and the Charts never get copied and added to the Emails.
Regards, and thanks in advance,
Santa |