Yeah sry about digging up this old post.
but tnx again balala, it worked.
Well, after i also added: if sOutput == 'Drive' then
return sDrive
At the bottom of the script.
I think i actually learned something about lua today. tnx
It is currently April 23rd, 2024, 9:45 pm
[Script] Path Parser
-
- Posts: 424
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
Re: [Script] Path Parser
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
-
- Rainmeter Sage
- Posts: 16164
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: [Script] Path Parser
But to be honest, if you need just the drive letter, there is no need to use a lua script. A simple String measure can do the job.
Eg, the following [MeasureDrive] measure returns the needed letter:
It's much more simpler and easier to use.
Eg, the following [MeasureDrive] measure returns the needed letter:
Code: Select all
[Variables]
Path=C:\Path\To\File.txt
[MeasureDrive]
Measure=String
String=#Path#
RegExpSubstitute=1
Substitute="^(.):.*$":"\1:"