CodeCode wrote: ↑October 26th, 2020, 2:52 pm
Code: Select all
[MeasureProcessTopOne]
Measure=Plugin
Plugin=Process
ProcessName=vlc.exe
Substitute="-1":" ","1":" Video Lan Running "
[MeasureProcessTopTwo]
Measure=Plugin
Plugin=Process
ProcessName=qbittorrent.exe
Substitute="-1":" ","1":"qBit Running "," ":"This House Is Clean ","[color=red][MeasureProcessTopOne]=1[/color]:""
Ok, so now the above represents my scenario - I hope...
If [MeasureProcessTopOne] equals 1, then [MeasureProcessTopTwo] will need, in my goal, to be "nullified" to be an empty string : "" <- like so.
The red part is what I am trying to figure out - it is not the correct code since I do not know what to put there it is just a "filler" for what really needs to be there.
Sorry, no. I just don't get it.
There is just no way that [MeasureProcessTopTwo], a Process plugin measure, can ever know anything about what the value of [MeasureProcessTopOne] is. Substitute isn't a way to ask any question about any measure except the one it is on. Substitute, at its core, is always saying "take a look at the string value of THIS measure, and act on that."
You can use a Calc measure to evaluate the value(s) of both measures, and use IfCondition to drive the Text option (or FontColor, or whatever) on a String meter if you want. Just forget about the Substitute(s) on the two measures.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
[MeasureProcessTopOne]
Measure=Plugin
Plugin=Process
ProcessName=vlc.exe
[MeasureProcessTopTwo]
Measure=Plugin
Plugin=Process
ProcessName=qbittorrent.exe
[MeasureEval]
Measure=Calc
Formula=1
IfCondition=(MeasureProcessTopOne = 1) && (MeasureProcessTopTwo = -1)
IfTrueAction=[!SetOption MeterResult Text "vlc is running and qbittorrent isn't"][!UpdateMeter *][!Redraw]
IfCondition2=(MeasureProcessTopOne = -1) && (MeasureProcessTopTwo = -1)
IfTrueAction2=[!SetOption MeterResult Text "Neither is running"][!UpdateMeter *][!Redraw]
IfCondition3=(MeasureProcessTopOne = -1) && (MeasureProcessTopTwo = 1)
IfTrueAction3=[!SetOption MeterResult Text "qbittorrent is running and vlc isn't"][!UpdateMeter *][!Redraw]
[MeterResult]
Meter=String
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Note that you don't absolutely need the separate Calc measure, as you can stick the IfCondition(s) directly on the [MeasureProcessTopTwo] measure if you want. I used the Calc measure mostly to make it clear that unlike Substitute/IfEqual/IfMatch, the IfCondition(s) are NOT about the measure they are on, but can easily reference and evaluate the values of multiple measures.