Hi,
i have a VERY annoying bug in a stay-open Applescript App i wrote. How the bug shows up:
i reopen the App
i execute some commands #unexpected :
pause for 3-4 seconds
the “Finder” activates
A snippet from the script ( the script’s structure isn’t strange or complicated )
on reopen
my run_scripts()
end reopen
on run_scripts()
set ls to ("A","B","C")
set ch to choose from list ls default items (item 1 of ls)
set ch to ch as text
if ch is "A" then
else if ch is "B" then
end
return
end
No other Applescripts nor Applescript Apps i created suffer from such a similar bug. From where could derive the damn error ? I’m sure it has something to do with the reopen-handler
I think you’re using the reopen handler wrong. It’s used for when the app is ALREADY RUNNING and you double click it again. So, you should display a dialog warning the user it’s already active etc. But you are doubling up the process, so I think it’s causing you the trouble.
Check this out:
Hi Chris,
i posted only a snippet of the whole script; the script itself IS a stay-open Application. Don’t know why my script activates the “Finder”, because i wrote no code for this in the script.
Uh, Oh.
i found the bug!
the culprit was a folder with an attached folder action script.
And my idle-app created some new files in these location.
Now, i’m happy again.