Hello everyone, I have a fairly simple example that I would appreciate some help with. I am trying to create a [MeterText] that displays the contents of a TextSample.txt file, updating every second. Whenever TextSample.txt changes, the [MeterText] should also change. This mostly works fine. However, when TextSample.txt is empty, then MeterText continues to display the previous text. Whereas, the desired behavior is that the [MeterText] should also display nothing when TextSample.txt is blank.
Does anyone have any idea why this doesn't work? Thanks!
My guess is that is the intended behavior for the plugin, so if the file is completely empty, it skips the file, though I don't know much on the Quote plugin. Trying it now, if you leave some kind of whitespace character (just a normal space works), it will display that line within the file, effectively displaying nothing but a blank space. If that space is still problematic, RegExpSubstitute=1 and Substitute="^ $":"" on the Quote plugin measure [MeasureText] does seem to replace the space, returning nothing as needed.
Last edited by Alex88 on October 3rd, 2020, 1:03 am, edited 1 time in total.
kaiblue wrote: ↑October 2nd, 2020, 6:49 pm
I am trying to create a [MeterText] that displays the contents of a TextSample.txt file, updating every second. Whenever TextSample.txt changes, the [MeterText] should also change. This mostly works fine. However, when TextSample.txt is empty, then MeterText continues to display the previous text. Whereas, the desired behavior is that the [MeterText] should also display nothing when TextSample.txt is blank.
Does anyone have any idea why this doesn't work?
Sorry being extremely late, but here is a solution, if you still are interested.
The culprit is the encoding of the file being read by the [MeasureText] measure (in this case C:\TextSample.txt). Its encoding is probably UTF-8 (in both Notepad and Notepad++). If you change the encoding to UTF-16 LE (Notepad) or UCS-2 LE BOM (Notepad++), it's gonna work, the skin / String meter will be updated, even if the file is left empty.
However i think a much better idea for this is to use WebParser measure to read the file, not a QuotePlugin measure. Please let me know if you are still interested and want some help with this.