Hello all, I have a script that calls another script (called docLoader, referenced in the docLoaderPath variable.
I have two other variables, 1) should the script run and 2) is it running already. If it shouldn’t run, then we just quit out (last else if). However if its already running, I want to delay 5 seconds (actually 30, 5 is for testing) and try again. I have a handler that reads these values from a plist. It works great. I want it to start over so it can read the values again…
I have the script below in the on run handler.
1-Can this work
2-If so, how… guessing it needs some reorg and either continue, or return statements in there, both of which I’ve not been as good at as I should…
The “testing” variable is a property… so I can test this… without the ‘tell me to quit’ throwing an error. I’m actually not sure whether I need that for a non-Stay Open app but its there…
Thanks, all…
if ((shouldScriptRun) and (scriptRunning = false)) then -- this means ready to run
tell application docLoaderPath
activate
end tell
if (testing = false) then tell me to quit
--if its already running
else if (shouldScriptRun) and (scriptRunning) then
delay 5
run script file thisScript
--doesn't matter if its running, it shouldn't either way gets possiblity 3 and 4
else if (shouldScriptRun = false) then
if (testing = false) then tell me to quit
end if