Re: Function to abort macro
Posted by
Herbie on
Oct 25, 2016; 3:48pm
URL: http://imagej.273.s1.nabble.com/Function-to-abort-macro-tp5017479p5017480.html
Matt,
why not use exit() ?
"exit() or exit("error message")
Terminates execution of the macro and, optionally, displays an error
message."
Best
Herbie
::::::::::::::::::::::::::::::::::::::::::::
Am 25.10.16 um 17:42 schrieb PEARSON Matthew:
> Hi all,
>
> Is there a function in the macro language that will just abort a macro, equivalent to pressing escape key. I have a radio button dialog and there a few options for the user to choose from and i wanted one of those to be an option to exit the macro. I see there is a run("Quit") command but that quit's imagej and is a little extreme. Something like run("Abort") would be nice but alas obviously doesn't exist. Alternatively some way to make the macro jump over my remaining code blocks if this "Exit" radio button is selected then it will end on its own. I've roughly copied the structure below to demonstrate what i'm trying to do.
>
> Thanks for the help!
>
> Matt
>
> Radio button dialog options:
> -Append results and next image
> -Skip image
> -Exit
>
> if "append" {
> statements
> }
>
> else if "skip" {
> statements
> }
>
> else {
> Exit macro somehow
> }
>
> Further code blocks associated with a loop outwith the above code
>
>
>
>
> --
> Matt Pearson
> Microscopy Facility
> MRC Human Genetics Unit
> Institute of Genetics and Molecular Medicine (IGMM)
> University of Edinburgh
> Crewe Road
> EH4 2XU
>
>
>
>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
>
>
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html