proc Main() string sixteenth[10] = "|Dur:16th" string sixteenthDot[17] = "|Dur:16th,Dotted" integer curr_line = 2 integer last_line integer find_one = 0 integer rc = 0 last_line = NumLines() - 4 while last_line > curr_line GotoLine(curr_line) //Place cursor at beginning of "curr_line" GotoColumn(1) rc = lFind(sixteenthDot,"") //Look for next dotted 16th if rc == 0 // If we can't find one break // get out of loop endif curr_line = CurrLine() //Save line number of this set Down() GotoColumn(1) rc = lFind(sixteenthDot,"c") //Look for middle dotted 16th if rc == 0 find_one = 0 else find_one = 1 endif Down() GotoColumn(1) rc = lFind(sixteenth,"c") //Look for last 16th note (last of triplet) if rc <>0 find_one = find_one + 1 // Will = 3 for a complete set endif GotoColumn(1) rc = lFind("Dotted","c") if rc == 0 find_one = find_one + 1 // Did not find last one dotted endif if find_one == 3 // Found set needing to convert GotoLine(curr_line) //Get back to top of set GotoColumn(1) Replace(sixteenthDot,"|Dur:8th,Triplet=First","cn") Down() //2nd line of set GotoColumn(1) Replace(sixteenthDot,"|Dur:8th,Triplet","cn") Down() //3rd (last) line of set GotoColumn(1) Replace(sixteenth,"|Dur:8th,Triplet=End","cn") curr_line = curr_line + 3 //Get ready for next set else curr_line = curr_line + 1 //That dotted 16th wasn't a triplet endif endwhile end