Starts recording a command. Does nothing if the recorder is not open or the command being recorded has called IJ.run().
(String command)
| 176 | not open or the command being recorded has called IJ.run(). |
| 177 | */ |
| 178 | public static void setCommand(String command) { |
| 179 | String threadName = Thread.currentThread().getName(); |
| 180 | boolean isMacro = threadName.startsWith("Run$_"); |
| 181 | if (threadName.contains("Popup Menu") || threadName.contains("Developer Menu")) |
| 182 | isMacro = false; |
| 183 | if ((isMacro&&!recordInMacros) || !recordingEnabled()) |
| 184 | return; |
| 185 | commandName = command; |
| 186 | commandOptions = null; |
| 187 | recordPath = true; |
| 188 | imageUpdated = false; |
| 189 | imageID = 0; |
| 190 | if (scriptMode) { |
| 191 | ImagePlus imp = WindowManager.getCurrentImage(); |
| 192 | imageID = imp!=null?imp.getID():0; |
| 193 | if (imageID!=0) |
| 194 | ImagePlus.addImageListener(instance); |
| 195 | } |
| 196 | //IJ.log("setCommand: "+command+" "+Thread.currentThread().getName()); |
| 197 | } |
| 198 | |
| 199 | /** Returns the name of the command currently being recorded, or null. */ |
| 200 | public static String getCommand() { |
no test coverage detected