Login  Register

IJ.getToolName() function

Posted by Roberto Sotto-Maior Fortes de Oliveira on Nov 23, 2009; 11:50pm
URL: http://imagej.273.s1.nabble.com/IJ-getToolName-function-tp3690354.html

Thanks to Wayne, the function IJ.getToolName(), released with version
1.43l solved the question.

Here is an example using that function:

// IJ.getToolName() Demo
// This macro demonstrates the use of the IJ.getToolName() function.

  requires("1.43l");
  setTool("point");
  requiredTool="multipoint"; // name of the required tool
  waitForUser("Please select the "+requiredTool+" tool.");
  if (IJ.getToolName()!=requiredTool) {
     showMessage("The "+ IJ.getToolName() +" tool is selected. Switching
to "+requiredTool+", which this macro requires.");
     setTool(requiredTool);
   }
//

Regards,

Roberto