Jython Script in Fiji vs. ImageJ

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Jython Script in Fiji vs. ImageJ

Alex-2
I've been developing a Jython script using JetBrains IntelliJ.  I've pointed IntelliJ to IJ.jar included with ImageJ 1.x for the development and running the script using IJ.jar (/Applications/ImageJ/ImageJ.app/Contents/Java/ij.jar) works fine.  Likewise, I've tried using the IJ.jar (/Applications/Fiji.app/jars/ij-1.52f-SNAPSHOT.jar) included with Fiji when developing using the IDE with no issue.


However, when I load the script into Fiji.app by placing it in /Applications/Fiji.app/Scripts/My Script/ and run it, there are differences in how the script is executed.  Specifically, when run through the IDE the script closes image windows without asking to "Save changes" where I am presented with the dialog when running through Fiji.  I believe the issue may be related to my closing windows using

WindowManager.closeAllWindows()


Attached is a screenshot of the dialog in question.

Is there a way to close the windows an insure that no "Save changes" dialog is shown?



Thanks

Alex




--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Screen Shot 2018-09-27 at 2.41.39 PM.png (92K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Jython Script in Fiji vs. ImageJ

Wayne Rasband-2
> On Sep 27, 2018, at 5:44 PM, Alex <[hidden email]> wrote:
>
> I've been developing a Jython script using JetBrains IntelliJ.  I've pointed IntelliJ to IJ.jar included with ImageJ 1.x for the development and running the script using IJ.jar (/Applications/ImageJ/ImageJ.app/Contents/Java/ij.jar) works fine.  Likewise, I've tried using the IJ.jar (/Applications/Fiji.app/jars/ij-1.52f-SNAPSHOT.jar) included with Fiji when developing using the IDE with no issue.
>
> However, when I load the script into Fiji.app by placing it in /Applications/Fiji.app/Scripts/My Script/ and run it, there are differences in how the script is executed.  Specifically, when run through the IDE the script closes image windows without asking to "Save changes" where I am presented with the dialog when running through Fiji.  I believe the issue may be related to my closing windows using
>
> WindowManager.closeAllWindows()
>
> Attached is a screenshot of the dialog in question.
>
> Is there a way to close the windows an insure that no "Save changes" dialog is shown?

Use

   IJ.run("Close All”)

-wayne

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html