It is currently October 15th, 2019, 5:01 am

Change FileView Path

General topics related to Rainmeter.
spykyvenator
Posts: 4
Joined: December 2nd, 2018, 4:46 pm

Change FileView Path

spykyvenator » August 10th, 2019, 1:42 pm

I wanted rainmeter to look in a folder based on a button.
But I couldn't get it to change the parent folder path, I tried a variable and !SetOption, but neither worked.
I want to avoid to set a new parent for each folder, this should be my final solution.

Here you've got my code lines:

Code: Select all

[HouseReveal]
Measure=Calc
Formula=1
IfCondition=(#MouseX# < 250) && (#MouseY# < 270)
IfTrueAction=[!ShowMeterGroup Games][!SetOption GamesPath Path "C:\Users\tom\Documents\GamesShortcuts"][!Redraw]
IfFalseAction=[!HideMeterGroup Games][!Redraw]
IfCondition2=(#MouseX# > 250) && (#MouseY# < 270)
IfTrueAction2=[!ShowMeterGroup Prog][!SetOption GamesPath Path "C:\Users\tom\Document\ProgShortcuts"][!Redraw]
IfFalseAction2=[!HideMeterGroup Prog][!Redraw]
IfCondition3=(#MouseX# > 250) && (#MouseY# > 270)
IfTrueAction3=[!ShowMeterGroup R][!SetOption GamesPath Path "C:\Users\tom\Documents\FilesShortcuts"][!Redraw]
IfFalseAction3=[!HideMeterGroup R][!Redraw]
IfCondition4=(#MouseX# < 250) && (#MouseY# > 270)
IfTrueAction4=[!ShowMeterGroup H][!SetOption GamesPath Path "C:\Users\tom\Documents\DriversShortcuts"][!Redraw]
IfFalseAction4=[!HideMeterGroup H][!Redraw]
DynamicVariables=1

;The Groups Refer To images which I cut out in this example

[GamesPath]
Measure=plugin
Plugin=FileView
Path="C:\Users\tom\Documents\GamesShortcuts"
Recursive=1
Count=7
HideExtensions=1
;Extensions=".exe"
DynamicVariables=1
ShowDotDot=0

[GamesName]
Measure=Plugin
Plugin=FileView
Path=[GamesPath]
Type=FileName
Group=Children
Index=#Index#
DynamicVariables=1

[GamesText]
meter=string
Meterstyle=StyleTimeText
MeasureName=GamesName
Fontsize=15
StringAling=Center
Group=Games
x=2400
y=400
W=1500
H=30
Text=%1
LeftMouseUpAction=[!CommandMeasure "GamesName" "Open"]
Last edited by balala on August 10th, 2019, 3:46 pm, edited 1 time in total.
Reason: Please use <Code> tags whenever are you posting code snippets. It's the </> button.
User avatar
jsmorley
Developer
Posts: 19544
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Change FileView Path

jsmorley » August 10th, 2019, 1:47 pm

FileView does not re-read the parent folder structure after the first update unless you specifically tell it to do so.

https://docs.rainmeter.net/manual/plugins/fileview/#Update

So you should include that as a part of all your IfTrueAction(s).

Code: Select all

IfTrueAction=[!ShowMeterGroup Games][!SetOption GamesPath Path "C:\Users\tom\Documents\GamesShortcuts"][!CommandMeasure GamesPath "Update"][!UpdateMeter *][!Redraw]
So the way to think about how FileView works is that when the skin is loaded or refreshed, the folder/file structures are read by the plugin. After that, the plugin DOES NOTHING, unless you specifically tell it to with one or more of the supported !CommandMeasure bangs. You certainly wouldn't want FileView to be just hammering on your hard drive once a second.

Also note that !Redraw by itself really doesn't do anything. It should always be combined with !UpdateMeter SomeMeter, !UpdateMeter *, or !UpdateMeterGroup SomeGroup.
spykyvenator
Posts: 4
Joined: December 2nd, 2018, 4:46 pm

Re: Change FileView Path

spykyvenator » August 10th, 2019, 3:55 pm

Thank you for your quick answer.