For some reason if I save my applet as enhanced it never really quits using:
my |quit|:sender
or
if (name of current application) is not "Script Debugger" then
tell current application
quit
end tell
end if
if I save it as a standard applet it quits normally.
The only reason I discovered the issue is I quit and re-opened it and the menus did not appear. When I resaved in script debugger it asked if I wanted to quit the applet and save.
set theApp to quoted form of "quit app \"Your App Name Here\""
do shell script "osascript -e " & theApp
or
do shell script "killall FancyDroplet"
the downside to this is it will kill all FancyDroplets running. Is there a way to rename the fancydroplet? I tried to do and change in info.plist without success.
Thank you for the response. Unfortunately it doesnt work with quit. I think it has to do with being a menubar app and setting Application is agent to true. Quit works as applet but not enhanced applet. I tried on a few menubar app samples I found online. Not sure why this works though:
set theApp to quoted form of “quit app “Your App Name Here”” do shell script "osascript -e " & theApp
I’m having trouble reproducing this problem here. I’ve tried a few things:
Quitting from the on run handler:
set shouldQuit to button returned of (display alert "Shall I quit" buttons {"OK", "Cancel"} default button "OK") = "OK"
if shouldQuit then
quit
end if
This works as expected, the applet quits.
From an on idle handler:
on idle
set shouldQuit to button returned of (display alert "Shall I quit" buttons {"OK", "Cancel"} default button "OK") = "OK"
if shouldQuit then
quit
end if
return 10
end idle
I also tried replacing the bare quit command with the code you cite. but there is no difference:
if (name of current application) is not "Script Debugger" then
tell current application
quit
end tell
end if
Sorry to reply here but I have the same issue
my app is quit perfectly when the process is Finnish but if I open the app and closed by the red button the app still open in the finder?
If the enhanced app window is closed the app does not quit. There does not seem to be a way to react to the window being closed. If the user clicks close the window closes but reopens again if progress is used.
Also I’ve noticed sometimes the enhanced apps don’t act the same way standard apps do when finished executing. They remain open, with their icon in the dock, rather than quitting.
Here’s an example. Save this script as an enhanced app and as an Apple app.
In the enhanced version the quit menu halts the script. It doesn’t run, it can’t quit and must be forced quit. Clicking stop, or selecting Quit from the dock doesn’t work. Force quitting is the only thing that works. Adding a “tell me to quit” to the quit handler doesn’t help.
In the standard version the quit menu has no effect.
In the enhanced version clicking the close window button closes the window, but it opens again at the next Progress update.
In the standard app the close window button is inactive.
property progressRecord : {ProgressTotalSteps:-1, progressCompletedSteps:0, progressDescriptionText:"", progressAdditionalDescriptionText:""}
on run
repeat with x from 1 to 20
delay 1
set ProgressTotalSteps of progressRecord to 20
set progressCompletedSteps of progressRecord to x
--set progressDescriptionText of progressRecord to ""
--set progressAdditionalDescriptionText of progressRecord to ""
my updateProgress()
end repeat
end run
on quit
continue quit
end quit
on updateProgress()
-- {ProgressTotalSteps:-1, progressCompletedSteps:0, progressDescriptionText:"", progressAdditionalDescriptionText:""}
tell progressRecord
set totalSteps to its ProgressTotalSteps
set completedSteps to its progressCompletedSteps
set descriptionText to its progressDescriptionText
set addDescriptionText to its progressAdditionalDescriptionText
end tell
set progress total steps to totalSteps
set progress completed steps to completedSteps
set progress description to descriptionText
set progress additional description to addDescriptionText
end updateProgress
We have improved the Enhanced Applet shell for the upcoming Script Debugger 7.0.8 maintenance release to address this issue. You can download a pre-release build here. Note that you’ll need to be part of our Beta Testing group to access this page - just PM me @alldritt to gain access.
FYI, just recompiling my applet with the 7.0.8 beta causes quitting to be 100% reliable for me on two Macs and several days’ use for now. I still needed to end my script with “tell me to quit”, however. Thanks!
7.0.8 beta works here, no issue on quiting
Great work thanks you DEV! I am Waiting for the release
Edit** 01 April
Small issue
Wnen I closed About this utility the entire program closed?