Avoiding to save code to macro recorder

imagej

#1

Hello everyone!
I’m developing a plugin and I need it to work with the macro recorder enabled.
This plugin has the following lines of code to select and delete Rois:

this.roiManager.setSelectedIndexes(roiIds);
this.roiManager.runCommand("Delete");

The plugin is running ok, however these two lines are inserting a great number of undesirable code in macro recorder.
A example below:

roiManager("Select", 0);
roiManager("Select", newArray(0,3));
roiManager("Select", newArray(0,3,4));
roiManager("Select", newArray(0,3,4,5));
...

I’d like to know how to avoid this recording even with the recorder turned on.
Thank you!