set lastCommand "" while { set curSeqState [stc::get sequencer1 -state] if {$curSeqState == "PAUSE" || $curSeqState == "IDLE"} { break } set CurrentCommand [stc::get sequencer1 -CurrentCommand] if {$lastCommand != $CurrentCommand} { puts $CurrentCommand set lastCommand $CurrentCommand } after 1000 }