/** Customizes macro recordings */ public static final void improveRecording() { if (Recorder.record) { String recordString = "// Recording Sholl Analysis version " + ShollUtils.version() + "\n" + "// Visit " + ShollUtils.URL + "#Batch_Processing for scripting tips\n"; final String cmd = Recorder.getCommand(); final String cmdOptions = Recorder.getCommandOptions(); if (cmd == null || cmdOptions == null) { recordString += "// NB: Commands dismissing prompts (such the ones in the \"More\u00bb\" dropdown menu) may not\n" + "// record properly. You may need to repeat recording if recorded instruction is invalid\n"; } Recorder.recordString(recordString); } }
/** Returns the contents of the next text area. */ public String getNextText() { String text = null; String key = "text1"; if (textAreaIndex==0 && textArea1!=null) { text = textArea1.getText(); if (macro) text = Macro.getValue(macroOptions, "text1", text); } else if (textAreaIndex==1 && textArea2!=null) { text = textArea2.getText(); if (macro) text = Macro.getValue(macroOptions, "text2", text); key = "text2"; } textAreaIndex++; if (recorderOn && text!=null) { String text2 = text; String cmd = Recorder.getCommand(); if (cmd!=null && cmd.equals("Calibrate...")) text2 = text2.replace('\n',' '); text2 = Recorder.fixString(text2); Recorder.recordOption(key, text2); } return text; }
final String commandName = Recorder.getCommand(); final String commandOptions = Recorder.getCommandOptions(); if (commandName != null && commandOptions != null && commandOptions.contains("browse")) {
/** Returns the contents of the next text area. */ public String getNextText() { String text = null; String key = "text1"; if (textAreaIndex==0 && textArea1!=null) { text = textArea1.getText(); if (macro) text = Macro.getValue(macroOptions, "text1", text); } else if (textAreaIndex==1 && textArea2!=null) { text = textArea2.getText(); if (macro) text = Macro.getValue(macroOptions, "text2", text); key = "text2"; } textAreaIndex++; if (recorderOn && text!=null) { String text2 = text; String cmd = Recorder.getCommand(); if (cmd!=null && cmd.equals("Calibrate...")) text2 = text2.replace('\n',' '); text2 = Recorder.fixString(text2); Recorder.recordOption(key, text2); } return text; }
public static void runNestedWithRecording(String command, String options){ String oldCommand = Recorder.getCommand(); Recorder.setCommand(command); Macro.setOptions(options); Executer ex = new Executer(command); ex.run(); Recorder.setCommand(oldCommand); } }
public void recordMacro() { if(Recorder.record) { String oldCommand = Recorder.getCommand(); Recorder.setCommand("Show results table"); Recorder.recordOption("action", getMacroName()); params.recordMacroOptions(); Recorder.saveCommand(); Recorder.setCommand(oldCommand); } }