Closed aghand0ur closed 9 years ago
Hi,
I tested and it seems you can't directly do that as when you call Icy.exit(..) all Plugin will receive an event to close properly. It's why you receive a message from the Script Editor to close the current script... the problem is that if you accept to close, the Script engine will actually kill itself while it's still executing the exit instruction... I got the script working by modifying it like this :
importClass(Packages.icy.system.thread.ThreadUtil)
importClass(Packages.icy.main.Icy)
var r = new java.lang.Runnable()
{
run: function()
{
// safe to wait a bit
ThreadUtil.sleep(500)
Icy.exit(false)
}
};
ThreadUtil.bgRun(r)
I also modified a bit the script editor plugin for better close operation handling but in the current case it does not make a real difference.
Thanks Stephane. The script you suggested works perfectly :) :+1:
You're welcome :)
Hi,
When I call "Icy.exit(bool)' inside the ScriptEditor plugin, the script stops execution but Icy is not closed. I expected this function once called to cause Icy GUI to close.
Any suggestions on this regard?