You are close to the answer...Hello everyone and sorry for my English.
I'm looking to change the color of text based on the last modification date of a file.
For this I use Jeffrey Morley's module, LuaTextFile2.0
The module simply reads the contents of a TXT file.
I would like to change the text color based on the last modification date of a specific file.
I try to adapt the module but it doesn't work, maybe the problem is Meter Display
Thank you all for your help.
Sincerely,
Let's start by creating a new variable 'SearchFile' and set it's value to 'test.txt'
Code:
[Variables]SearchFile=test.txt
Code:
; Reads the 'Path' and contains one file information, if 'SearchFile' is found[MeasureFile]Measure=PluginPlugin=FileViewPath="C:\Temp"ShowDotDot=0ShowFolder=0Count=1WildcardSearch=#SearchFile#
Code:
[MeasureFileCount]Measure=PluginPlugin=FileViewPath=[MeasureFile]Type=FileCount
Code:
[MeasureFileDate]Measure=PluginPlugin=FileViewPath=[MeasureFile]Index=1Type=FileDateDateType=Modified
If the file is not found, the NUMBER value of [MeasureFileDate] will be zero
Note: IfConditions will ALWAYS use the NUMBER value of the measures, so the Timestamp values are used to compare the dates
Code:
[MeasureTime]Measure=TimeIfCondition=(MeasureFileDate < MeasureTime)&&(MeasureFileDate <> 0)IfTrueAction=[!SetOption MeterDisplay FontColor "255,0,0,255"][!UpdateMeter MeterDisplay][!Redraw]
Code:
[MeterDisplay]Meter=StringMeasureName=MeasureFileDateW=300H=500FontFace=Segoe UIFontSize=11FontColor=255,255,255,255SolidColor=0,0,0,1AntiAlias=1ClipString=1Text=FILE: #SearchFile##CRLF#MODIFIED: %1; Condition pour changer la couleur du texte si la date de modification est inférieure à la date d'aujourd'hui; DynamicVariables=1
Let us know if you have any questions.
Statistics: Posted by eclectic-tech — Today, 3:09 am