Page 2 of 2

Re: [Script] Path Parser

Posted: May 30th, 2017, 8:00 pm
by StArL0rd84
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

Re: [Script] Path Parser

Posted: May 30th, 2017, 8:12 pm
by balala
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:

Code: Select all

[Variables]
Path=C:\Path\To\File.txt

[MeasureDrive]
Measure=String
String=#Path#
RegExpSubstitute=1
Substitute="^(.):.*$":"\1:"
It's much more simpler and easier to use.