function function_GenerateMacroTitle() {
// Generates a macro header and saves it to clipboard
// Part of SMM_CustomMacros.ijm
// Dialog to check details & store locally
contact = call("ij.Prefs.get", "SMM.GenerateMacroTitle.contact", "Default Contact");
location = call("ij.Prefs.get", "SMM.GenerateMacroTitle.location", "Default Location");
email = call("ij.Prefs.get", "SMM.GenerateMacroTitle.email", "Default@Email");
Dialog.createNonBlocking("Macro Header Generator");
Dialog.addString("Title", "", 30);
Dialog.addString("Contact person", contact, 30);
Dialog.addString("Location or Address", location, 30);
Dialog.addString("Email address", email, 30);
Dialog.addHelp("A custom header will be added to the system clipboard for you");
Dialog.show();
title = Dialog.getString();
contact = Dialog.getString();
location = Dialog.getString();
email = Dialog.getString();
call("ij.Prefs.set", "SMM.GenerateMacroTitle.contact", contact);
call("ij.Prefs.set", "SMM.GenerateMacroTitle.location", location);
call("ij.Prefs.set", "SMM.GenerateMacroTitle.email", email);
star_count = "";
for (i=0; i 0) {print(loop); exit();}
// Action
if(action=="Encode"){str = function_StringScramble(string, key);} else {str = function_StringDescramble(string, key);}
str = replace(str, "\\\\n", "\n");
// Load to clipboard
String.resetBuffer;
String.append(str);
String.copy(String.buffer);
// Show messge
showMessage("Your string has been "+action+"d and is in the clipboard");
//return String.buffer;
tool_DeScramble ();
/* TODO
Keep in position after completion i.e. get window position, put back in window position on OK
*/
}
function function_ArrayIndex(a, value){
for (i=0; i
"
+"Useful tools
"
+"Some useful tools to play with
"
+"";
Dialog.addHelp(html);
// Tools
if (choice==""){choice=toolList[0];}
Dialog.addChoice("Tool", toolList, choice);
Dialog.show();
choice = Dialog.getChoice();
index = function_ArrayIndex(toolList, choice);
script = toolMacro[index];
eval(script);
menu();
}