Out of sync properties (Viewerpane status e.g)

Hello all.. o)

I was trying to enhance a little script, that toggles the viewerpane. I noticed, that I cannot reliably get the current viewerpane status, even if I make use of Lister.Update() before accessing the viewerpane property.

Please watch the output of the CLI below, it should print "0 1 0 1 0 1 .." in each line, because I toggle the viewerpane on or off, call Lister.Update() and right after I catch the value of Lister.ViewerPane. The output shows, that Lister.Viewerpane is not always responding to a "SET VIEWPANE=on/off" command or the other way round.



Notice, the result shown is really bad currently. It was just yesterday when only half of the lines were showing "NOT UPTODATE". So this may depend on system load or usage as well I guess.

var cmd = DOpus.Create.Command(); var lister = DOpus.Listers.LastActive(); var tab = lister.activetab; cmd.SetSourceTab(tab); for(var i=0;i<10;i++) TortureViewerPane(lister,cmd); DOpus.Output("done."); function TortureViewerPane(lister,cmd){ var s = ""; for(var i=0;i<10;i++){ cmd.RunCommand("Set VIEWPANE=off"); lister.Update(); s += lister.viewpane + " "; cmd.RunCommand("Set VIEWPANE=on,vert"); lister.Update(); s += lister.viewpane + " "; } var failed = (s=="0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 "?"":" NOT UPTODATE!"); DOpus.Output("StatusHistory: " + s + failed); }
I noticed similar behaviour when using Update() on the tab object while toggling the checkbox mode on/off.
I need to use Delay() in a while-loop and actually wait for the property to switch, which is no solution, when trying to fetch the current status, which I did not toggle right before by myself.

Any ideas on that appreciated! Cya tb..