How can I know I'm in a macro or a plugn?

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

How can I know I'm in a macro or a plugn?

Philippe CARL
Dear all,

I’m in the process of trying to convert a macro into a plugin.

And by doing so, when within this plugin I launch another plugin having
macro extensions, it gives me the following error: "Macro must be running to
install macro extensions".

Thus I thought I can exclude the fact of launching the execution within a
macro or a plugin by using the Boolean instruction IJ.isMacro() which
"returns true if a macro is running, or if the run(), open() or newImage()
method is executing".

But given that the launching is done through an IJ.run instruction, the
IJ.isMacro() is giving true whether it is done through a macro or a plugin.

There is as well the IJ.macroRunning() which "Returns true if the run(),
open() or newImage() method is executing".

But with both methods, I can’t do (unless I don’t know how) something like
IJ.isMacro() - IJ.macroRunning() to get a true only in the case I’m within a
macro.

I thank you very much in advance for your help and ideas.

My best regards,

Philippe

 

Philippe CARL

Laboratoire de Bioimagerie et Pathologies

UMR 7021 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84


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