Enhanced App stays open

I think this has been mentioned before, but Enhanced Apps seem to stay open after the script stops running, when the app is not saved as a stay open.

In my case the last instance of the Progress display is on the screen and the user needs to quit the “Stop” button.

Is this normal behavior?

No, the applet should quit.

We can not reproduce this in a simple test. Please send us an example script that demonstrates the problem you are experiencing. The shorter the better.

Thanks.

ImportMasterlogs copy.app.zip (3.3 MB)

OK, this is not exactly short, but exhibits the behavior on my laptop.

–> Script Debugger 7.0.12 (7A112)
–> Mac OS 10.13.6 (17G13035)

I’m going to try it on my desktop next. It’s basically a script I’ve worked on with all the handlers gutted, except for the progress handlers. When the script execution is complete the app says open with the last progress status displaying.

When I say it’s not short, I mean it’s kind of a long script, but it takes just a few seconds to run.

Like 2 seconds on my mac mini

So, the first time I ran it (from my desktop folder) it stayed open.

Next couple times it started running and crashed (unexpectedly quit).

I copied it from my desktop to a folder (that’s actually on the desktop) and it ran multiple times without crashing and without closing/quitting and with the final progress display on the screen.

Clicking Stop quits it.
–> Script Debugger 7.0.12 (7A112)
–> Mac OS 10.11.6 (15G22010)

It stays open here too — but the dialog says stuck on “250 of 256 done so far”. So I’m thinking it’s not quitting because something is going wrong in the script.

OK, I see the issue now. It’s the presence of an open handler that triggers the issue.

1 Like

The progress is only updated with every 10 steps, and I deliberately used a number not divisible by 10, incase that was related. But it seems like you’ve found the answer.

Cool.

and a run handler together.

As soon as you said open handler I knew it had to have both. And I’ll bet an explicit run handler too.

I’ve been looking into this and the presence of an on open handler causes an Enhanced Applet to remain running when the on run handler finishes.

There is a bug in that the display does not switch to the Droplet screen once the on run handler completes. I’ll fix this for the next Script Debugger 7 build.

If you want to force the enhanced applet to quit, place a quit statement at the end of your on run handler.

I’ve been having a related (but seemingly different) issue.

My enhanced applet is a stay open applet with an explicit quit handler. The quit handler is invoked without issue and seems to get to the point where the continue quit statement is executed but then like in Ed’s situation the window closes but leaves an indeterminate progress indicator running. I can hit the close button and it disappears and then reappears. If I hit the close button a second time it sometimes quits and sometimes crashes.

I will try and prepare an example applet for you to reproduce but going to bed now.

I have been able to get around this by using the following:

tell current application
	do shell script "killall FancyDroplet"
end tell