Login  Register

Re: Disable the cancel button on a macro dialog box

Posted by Brandon Hurr on Mar 18, 2015; 3:53pm
URL: http://imagej.273.s1.nabble.com/Disable-the-cancel-button-on-a-macro-dialog-box-tp5012041p5012043.html

Matt,

I've had similar issues when looping through many images in a folder where
user input is required. The data would be output to a results table and
only saved to a file when done looping. I quickly learned that I would
forget to save the file when it errored, or the error was so critical it
would cause a crash and I would lose the table.

Essentially, I wrote the file out at the end of every loop so I wouldn't
lose more than a single file's data. I thought this would cause a
performance hit, but in my case the hit was negligible.

HTH,

Brandon

On Wed, Mar 18, 2015 at 8:35 AM, mattjackson <[hidden email]> wrote:

> I have a dialog box within my macro. There's a lot of interaction here
> (over
> the course of hours), and just every so often, I accidentally hit the
> cancel
> button, abort the macro, and lose all the data.
>
> So, does anyone know of a way to disable the cancel button or retrieve the
> cancel call within the macro and do some if structure to avoid aborting the
> program?
>
> Or, is there a way to store certain arrays even if the cancel button is
> hit?
> That is, instead of purging the data and losing it, can I program the macro
> to auto-write in any case the macro is terminated?
>
> Thanks so much,
> Matt
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Disable-the-cancel-button-on-a-macro-dialog-box-tp5012041.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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