Add "wait" to let Status Bar update

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Malarki
Posts: 109
Joined: 03 Dec 2019 02:51

Add "wait" to let Status Bar update

Post by Malarki »

Working on a script that steps through video files and calls ffmpeg to check some characteristics of each. I have a "status" command to show the current video filename in the Status Bar. However, after several videos this status display would freeze, even though the script continued to work through the videos and eventually reached its end. Looking at the status log later verified this. Also, pressing ESC would not stop the script until it was done. I've run into this several time before.

Finally solved it by adding a "wait 100;" command just before each "status" command. Now the Status Bar updates nicely and ESC can break execution as desired.

Info for those who might need it. I didn't find that this had been addressed in the Help or in the forum.

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Add "wait" to let Status Bar update

Post by highend »

A value of one 1 would do the same and does not extend the runtime of the script for such a large amount
One of my scripts helped you out? Please donate via Paypal

Malarki
Posts: 109
Joined: 03 Dec 2019 02:51

Re: Add "wait" to let Status Bar update

Post by Malarki »

My videos take about 10 sec each to verify. I didn't want to spend more time experimenting on sets of them, and the 0.1 sec additional per file doesn't matter in this case.

I suggest adding a tip on this subject to the Help on SC 'status'. (I can't now find the thread for Help improvement suggestions.) Status line freeze has always been a mystery... I thought maybe XY was having to clear string space or something and never caught up, and the test cases were typically tedious so I gave up. I'm glad to have resolved it.

Malarki
Posts: 109
Joined: 03 Dec 2019 02:51

Re: Add "wait" to let Status Bar update

Post by Malarki »

I suggested adding a note to the Help for SC Status (to precede it with e.g. a "Wait 1;" command). But that's really a workaround. Maybe even better would be to code SC Status itself to give the OS that 1 millisecond to catch up.

Again, I've had this happen a number of times and never had a clue what was causing it.

Post Reply