procedure tmakefile (file_out, startNum, stopNum, prefixOU, anyExtn, extnOU, padOU, listImgs) string file_out {prompt="Name of filename list"} int startNum {1, prompt="Number of first file"} int stopNum {prompt="Number of last file"} string prefixOU {"", prompt="Prefix for output filenames"} bool anyExtn {no, prompt="Any extension following file number?"} string extnOU {"", prompt="Extension for output filenames"} bool padOU {yes, prompt="Pad numbers of output filenames?"} bool listImgs {yes, prompt="List images written to file?"} begin int i string thouZero # optional extra zero if images run into 1000s string oldFilename string newFilename string commandLine thouZero = "" if (stopNum > 999) { thouZero = "0" } for (i=startNum; i<=stopNum; i+=1) { # Initially assume unpadded filenames; then change if req'd: newFilename = prefixOU//i # initially assume no extension and then change if required. if (anyExtn == yes) { newFilename = prefixOU//i//extnOU } thouZero = "0" # since image names are padded into the thousands at AAT # Padding number in new filename if req'd: if (padOU==yes) { if (anyExtn == yes) { if (i<10) { newFilename=prefixOU//thouZero//"00"//i//extnOU } else if (i<100) { newFilename=prefixOU//thouZero//"0"//i//extnOU } else if (i<1000) { newFilename=prefixOU//thouZero//i//extnOU } else { newFilename=prefixOU//i//extnOU } } else { if (i<10) { newFilename=prefixOU//thouZero//"00"//i } else if (i<100) { newFilename=prefixOU//thouZero//"0"//i } else if (i<1000) { newFilename=prefixOU//thouZero//i } else { newFilename=prefixOU//i } } } if (listImgs==yes) { print(newFilename) } print(newFilename, >> file_out) } # Printing a sample line (the last) from the mv-file: # print(file_out) # print("last line:") # print(commandLine) end