Macro to set shortcut for Multi-point counter type


In cell counter plugin, there is a macro that can set counter type. I’m wondering how I can do that in “Multi-point tool”.

The macros for cell counter is

macro "Type 1 [1]" {call("CellCounter.setType", "1");}

I have tried the below and some similar names, but it doesn’t work.

macro "Type 1 [1]" {call("Multi-point.setType", "1");}


The macro recorder records the following code after I change the counter type in the multi-point tool options dialog and click ok:

run("Point Tool...", "type=Crosshair color=Yellow size=Medium label counter=0");

Note: There seems to be a bug in recording here: the Counter value recorded seems to be the currently active, not the one you choose (@Wayne might know how to fix this).
Nevertheless, setting the counter with macro code like the following works fine:

run("Point Tool...", "label counter=2");

Thanks, Jan! (New to ImageJ. Glad to know there is a macro recorder.)

Putting the code below in StartupMacros works for me.

  macro "Type 0 [0]" {run("Point Tool...", "label show counter=0");}
  macro "Type 1 [1]" {run("Point Tool...", "label show counter=1");}
  macro "Type 2 [2]" {run("Point Tool...", "label show counter=2");}

Because I want to keep Label Points and Show all active all the time, otherwise it will not be active after I hit the designed shortcut key.

As Jan mentioned, there are some bugs. Actually, I find, after you click OK in the Point Tool window, the macro recorder records the last chosen value set.

Besides (a little bit detour):

  1. The Color option in Point Tool seems does not work for me. Nothing changes when I change it.
  2. While the Point Tool window is opening, I cannot use the designed shortcut key. It has to be closed.


Windows 10 Enterprise
(Fiji Is Just) ImageJ 2.0.0-rc54; Java 1.8.0_66 [64-bit]
1 Like

Yes, in multi-point mode, the colors are hard-coded, and the setting is ignored. This has been discussed here:

As guess that is intentional, as running keylisteners on input dialog would interfere with input fields for e.g. text and numbers.

1 Like