// CalculateMean // // This is an example of a macro that is designed to be // called from other macros using the runMacro() function. // It uses the split() function to extract the values from // the string passed to it by runMacro(), calculates the mean, // then returns it to the calling macro as a string. To test it, // save this file in the macros folder, select the last three // lines, then use use the File>Run Macro command (ctrl-r). values = getArgument(); return toString(mean(values)); exit; function mean(values) { if (lengthOf(values)==0) return 0; a = split(values, ""); sum = 0; for (i=0; i