continueRoutine = False Problem, although it is in Each Frame

Put Idx = 0 in a Begin Experiment tab

Put Idx +=1 at the end of an End Routine tab in the final routine of the loop

Use Idx instead of trials.thisN