It is currently April 24th, 2024, 4:11 am

File Name without Path

Tips and Tricks from the Rainmeter Community
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

File Name without Path

Post by ~Faradey~ »

Hi all)
I thought this would be interesting for you guys!
While i was updating my Suite to 4th ver i have added an ability to show file name without a path and file extension and also i wanted it to be done in Rainmeter natively...so, here is my method.

latest beta required to be installed for proper work!

Code: Select all

[Rainmeter]
Update=1000

[Variables]
ImagePath=%USERPROFILE%\Pictures\
SubFolders=1
FileFilter=*.jpg;*.jpeg;*.png;*.bmp
UpdateRate=600

[mPic]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=#ImagePath#
FileFilter=#FileFilter#
Subfolders=#SubFolders#
UpdateDivider=#UpdateRate#
Disabled=0

[FileName_Ext]
Measure=TIME
Format=[mPic]
DynamicVariables=1
RegExpSubstitute=1
Substitute="\\(.*)\\":"","^.:":"","...\D$":""
UpdateDivider=#UpdateRate#
Disabled=0

[mSlideshow]
Meter=IMAGE
MeasureName=mPic
MeasureName2=FileName_Ext
X=0
Y=0
W=250
Hidden=0
ToolTipText=" %2"
ToolTipType=0
UpdateDivider=#UpdateRate#
in case you want to have a file extension to be shown, remove this ,"...\D$":"" from Substitute

...i know, that the regular expressions pattern which i used is not perfect, but it works...help me to improve it :thumbup:
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

Re: File Name without Path

Post by fabularasa »

It's just what I need

:thumbup: