// undo.ltgs  		
//
// Desctription: script to be used instead of shortcut undo with dtPlus.ltgs looper script.
// 		When dtPlus.ltgs is with pUniqueLoopLength false, the undo stops working when there is only 2 recors loops left
//		This is necessary since the first loops are incrementally created			
//
// Author: LoopToGo
//
// Arguments or user arguments : 
// 		None	



if $pUniqueLoopLength
	shortcut "Ctrl+Z" 
	endScriptDynamic
endIf

for i 1 $nbLoops

	variable loopID loopID & $i
	getLoopType loopType $$loopID
	
	if $loopType = Record
		variable nbRecordLoops $nbRecordLoops + 1
	endIf
	
endFor 


if $nbRecordLoops > 2
	shortcut "Ctrl+Z" 
endIf	