Quitting ImageJ cleanly in OSX for shutdown?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Quitting ImageJ cleanly in OSX for shutdown?

Christianname Surname
Hi all,

  I'm running a macro in 1.39e (using the app's front-end, not running
the .jar) and when the macro terminates normally I'd like to completely
quit ImageJ so that the computer will see no apps running and properly
shut down at a set time.

  As now happens, the macro terminates normally and when shutdown time
comes along the OS sees ImageJ is still running, tries to quit it and is
presented with the "Are you sure you want to quit ImageJ?" dialog.  And
sits waiting for a response == no shutdown.

  I guess what I'm kind of hoping-for would be a quit() function to go
along with exit().

  Has anyone run into this before?  Thanks for any help.

·§·
Reply | Threaded
Open this post in threaded view
|

Re: Quitting ImageJ cleanly in OSX for shutdown?

Gabriel Landini
On Friday 02 November 2007, Christianname Surname wrote:
>   As now happens, the macro terminates normally and when shutdown time
> comes along the OS sees ImageJ is still running, tries to quit it and is
> presented with the "Are you sure you want to quit ImageJ?" dialog.  And
> sits waiting for a response == no shutdown.
>
>   I guess what I'm kind of hoping-for would be a quit() function to go
> along with exit().

If there are no other good solutions, you could try the IJ_Robot plugin at the
end of your macro which [if you set the IJ window at a predetermined
position] could close IJ wait a bit and then click on the "No".
It is not an elegant way of doing it but it would probably work.

The plugins is here:
http://www.dentistry.bham.ac.uk/landinig/software/software.html

Cheers,

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Quitting ImageJ cleanly in OSX for shutdown?

Wayne Rasband
In reply to this post by Christianname Surname
A macro can force ImageJ to quit by calling run("Quit"). In v1.39h  
and later, the "Are you sure you want to quit ImageJ?" dialog is not  
displayed when a macro invokes the Quit command using run("Quit").  
You can also avoid the dialog by having the macro close all the image  
windows before quitting.

-wayne

On Nov 2, 2007, at 11:45 AM, Christianname Surname wrote:

> Hi all,
>
>   I'm running a macro in 1.39e (using the app's front-end, not running
> the .jar) and when the macro terminates normally I'd like to  
> completely
> quit ImageJ so that the computer will see no apps running and properly
> shut down at a set time.
>
>   As now happens, the macro terminates normally and when shutdown time
> comes along the OS sees ImageJ is still running, tries to quit it  
> and is
> presented with the "Are you sure you want to quit ImageJ?" dialog.  
> And
> sits waiting for a response == no shutdown.
>
>   I guess what I'm kind of hoping-for would be a quit() function to go
> along with exit().
>
>   Has anyone run into this before?  Thanks for any help.
>
> ·§·
Reply | Threaded
Open this post in threaded view
|

Re: Quitting ImageJ cleanly in OSX for shutdown?

Christianname Surname
In reply to this post by Christianname Surname
Thanks for the tip Wayne - I downloaded 1.39h and still couldn't get it to
quit properly even with all the image windows closed (and 'results' and
'log'), when it suddenly occurred to me to try closing the macro's window
too (just before the 'run("Quit")').  This made it work.  Duh.  I never
thought to close the macro's window while it was running.

Suggestion: I think that this procedure might be something good to add as an
aside in the description of the 'exit()' function in the documentation.

___

> A macro can force ImageJ to quit by calling run("Quit"). In v1.39h  
> and later, the "Are you sure you want to quit ImageJ?" dialog is not  
> displayed when a macro invokes the Quit command using run("Quit").  
> You can also avoid the dialog by having the macro close all the image  
> windows before quitting.

> -wayne