It is currently May 19th, 2019, 7:40 am

FileView: Recursive=2

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

FileView: Recursive=2

jsmorley » March 3rd, 2013, 5:55 pm

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
You do not have the required permissions to view the files attached to this post.
User avatar
moshi
Posts: 1851
Joined: November 13th, 2012, 9:53 pm

Re: FileView: Recursive=2

moshi » March 4th, 2013, 5:56 pm

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: 19245
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: FileView: Recursive=2

jsmorley » March 4th, 2013, 6:01 pm

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: 1851
Joined: November 13th, 2012, 9:53 pm

Re: FileView: Recursive=2

moshi » March 4th, 2013, 7:02 pm

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

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

Re: FileView: Recursive=2

Brian » March 5th, 2013, 2:04 am

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: 1851
Joined: November 13th, 2012, 9:53 pm

Re: FileView: Recursive=2

moshi » March 5th, 2013, 2:38 am

looking forward to it :)