It is currently March 28th, 2024, 9:03 am

FileView: Recursive=2

Changes made during the Rainmeter 2.5 beta cycle and earlier.
Post Reply
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

FileView: Recursive=2

Post by jsmorley »

Brian has added a new Recursive=2 option to the FileView plugin.

Recursive=0
No recursion into sub-folders is done at all

Recursive=1
The plugin searches all sub-folders updating only the file count, folder count and overall folder size. This option does not index specific files in sub-folders.

Recursive=2
The plugin indexes all files in the folder tree defined in Path. Folders are not indexed. Plugin commands FollowPath and PreviousFolder are disabled, and ShowFile, ShowFolder, and ShowDotDot options have no effect. WildcardSearch will only work if the file is found in a folder that also matches the pattern.

Recursive=2 is quite handy to duplicate the Quote plugin, which can return a random image from any folder or tree of folders. The advantage to using FileView for this is that quite a bit more information about the file can be obtained and used at the same time.
3-3-2013 12-49-40 PM.jpg

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
MyPath="C:\Users\Jeffrey\Pictures"
SecondsBetween=15

[MeasureFolder]
Measure=Plugin
Plugin=FileView
Recursive=2
Path=#MyPath#
Extensions=png;jpg;bmp
FinishAction=[!EnableMeasure MeasureCurrentIndex][!ShowMeterGroup AllMeters]

[MeasureCount]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileCount

[MeasureCurrentIndex]
Measure=Calc
Formula=Random
UpdateRandom=1
HighBound=[MeasureCount:0]
LowBound=1
UpdateDivider=#SecondsBetween#
DynamicVariables=1
Disabled=1

[MeasureImageFileSpec]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FilePath
IgnoreCount=1
Index=[MeasureCurrentIndex]
DynamicVariables=1

[MeasureImagePath]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FilePath
IgnoreCount=1
Index=[MeasureCurrentIndex]
DynamicVariables=1
RegExpSubstitute=1
Substitute="^(.+)\\([^\\]+)$":"\1"

[MeasureImageName]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileName
IgnoreCount=1
Index=[MeasureCurrentIndex]
DynamicVariables=1

[MeasureImageSize]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileSize
IgnoreCount=1
Index=[MeasureCurrentIndex]
DynamicVariables=1

[MeasureImageDate]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileDate
IgnoreCount=1
Index=[MeasureCurrentIndex]
DynamicVariables=1

[MeterBackground]
Meter=Image
Group=AllMeters
W=210
H=228
SolidColor=50,50,50,255
Hidden=1

[MeterImage]
Meter=Image
Group=AllMeters
MeasureName=MeasureImageFileSpec
X=5
Y=5
W=200
H=125
PreserveAspectRatio=2
LeftMouseUpAction=["[MeasureImageFileSpec]"]
DynamicVariables=1
Hidden=1

[MeterName]
Meter=String
Group=AllMeters
MeasureName=MeasureImageName
X=5
Y=5R
W=200
H=18
FontFace=Segoe UI
FontSize=10
FontColor=255,255,255,255
StringStyle=Bold
ClipString=1
AntiAlias=1
Hidden=1

[MeterPath]
Meter=String
Group=AllMeters
MeasureName=MeasureImagePath
X=5
Y=R
W=200
H=36
FontFace=Segoe UI
FontSize=10
FontColor=255,255,255,255
StringStyle=Bold
ClipString=1
AntiAlias=1
Hidden=1

[MeterSize]
Meter=String
Group=AllMeters
MeasureName=MeasureImageSize
X=5
Y=R
W=200
H=18
FontFace=Segoe UI
FontSize=10
FontColor=255,255,255,255
StringStyle=Bold
AutoScale=1
AntiAlias=1
Text=%1B
Hidden=1

[MeterDate]
Meter=String
Group=AllMeters
MeasureName=MeasureImageDate
X=5
Y=R
W=200
H=18
FontFace=Segoe UI
FontSize=10
FontColor=255,255,255,255
StringStyle=Bold
AntiAlias=1
Hidden=1
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: FileView: Recursive=2

Post by moshi »

i am using Recursive=2 to index and display all entries in my start menu.

when i am using this with WildcardSearch=*rain* it will display only entries in the top level folder and in subfolders that also match the wildcard.

\Rainmeter.lnk would be displayed
\Rainmeter\Rainmeter.lnk would be displayed
\Tools\Rainmeter.lnk would not be displayed
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: FileView: Recursive=2

Post by jsmorley »

moshi wrote:i am using Recursive=2 to index and display all entries in my start menu.

when i am using this with WildcardSearch=*rain* it will display only entries in the top level folder and in subfolders that also match the wildcard.

\Rainmeter.lnk would be displayed
\Rainmeter\Rainmeter.lnk would be displayed
\Tools\Rainmeter.lnk would not be displayed
Correct. That is more or less what I said in the post above.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: FileView: Recursive=2

Post by moshi »

oops. looks like i skipped that part. :oops:

i wish it would work like the Windows search function.
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: FileView: Recursive=2

Post by Brian »

I am using a Windows API function to "search" for files/folders containing the "WildcardSearch" option. The problem is really in how that function is implemented. It is actually a shame that Windows hasn't opened that function up to some better options because there are a lot of developers out there asking why you cannot search an entire folder and its sub-folders for files using wildcards.

Anyway, I have a workaround that will solve this problem so that all sub-folders will be searched despite what the "WildcardSearch" option says. This will be in the next beta.

-Brian
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: FileView: Recursive=2

Post by moshi »

looking forward to it :)
Post Reply