IJ.getToolName() function

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

IJ.getToolName() function

Roberto Sotto-Maior Fortes de Oliveira
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