FileView plugin

Plugin=FileView retrieves information about folders and files.

The plugin gathers all the folder and file names, sizes, dates and icons in the selected folder. It counts the number of files and folders and obtains the combined size. It can also search recursively through all the subfolders of the selected folder to obtain the totals for count and size.

FileView operates with a "parent / child" approach. A main "parent" FileView measure is used to obtain all the information for a selected folder, and then "child" measures are used to read individual entries from the parent using the Path= option.

Usage

FileView measures take the form:

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureFolder]
Measure=Plugin
Plugin=FileView
Path="C:\Program Files\Rainmeter"
ShowDotDot=0
ShowFolder=0
Count=3

In this example, this "parent" measure will obtain name, size, date and icon information about all files in the selected folder, then create three Index values for the first three files. The information is used in subsequent "child" FileView measures:

[MeasureChild1]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileName
Index=1

[MeasureChild2]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileName
Index=2

[MeasureChild3]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileName
Index=3

The values of the three child measures are now the FileName information parsed into Indexes 1 through 3 by the parent measure. These can then be used with MeasureName and other options in meters.

Another way to use the information in child measures is:

[MeasureChild1]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileName
Index=1

[MeasureChild2]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileSize
Index=1

[MeasureChild3]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileDate
Index=1

The values of the three child measures are now the FileName, FileSize and FileDate information from the first file (Index 1) of the parent measure.

In these examples, three indexes are created due to the Count=3 option on the parent measure. However, the information for all files and / or folders are obtained by the plugin, and subsequent or previous entries can be assigned to the three indexes by using !CommandMeasure statements described below. This will allow a skin to "scroll" through the files and / or folders in a dynamic way.

Important Note: A FileView measure will not re-read the disk information on a normal update cycle or using UpdateDivider on the measure, nor when the !Update / !UpdateMeasure bangs are used. If the options on the parent measure are changed dynamically with !SetVariable or !SetOption, the Update plugin command will need to be used to update the values.

[MeasureFolder]
Measure=Plugin
Plugin=FileView
Path="C:\ImageFolder"
Count=3

[MeterChangeFolder]
Meter=Image
W=26
H=25
SolidColor=0,0,0,255
LeftMouseUpAction=[!SetOption MeasureFolder Path "C:\VideoFolder"][!CommandMeasure MeasureFolder Update]

If it is desired that a folder be monitored for new or changed files, the Update plugin command should be used in conjunction with an OnUpdateAction statement to keep the measure current with changing disk information. Be aware that having the plugin physically access the disk has a performance cost, and care should be taken to use an approriate UpdateDivider.

[MeasureFolder]
Measure=Plugin
Plugin=FileView
Path="C:\ImageFolder"
Count=3
UpdateDivider=5
OnUpdateAction=!CommandMeasure MeasureFolder Update

Options

General measure options

All general measure options are valid.

Path

In a parent measure, defines the path of the folder to read. By default, the My Computer folder is used.

Note: While #Variables# can be used in the parent Path option, [SectionVariables] cannot, as this is ambiguous with the parent definition in a child measure.

In a child measure, defines the parent measure [MeasureName] to read values from.

Parent measure options

FinishAction

Action to execute when the plugin has completed reading the folders and files. This can be used to ensure that a large folder structure is fully read before other actions are taken.

Recursive Default: 0

If set to 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.

If set to 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.

Count Default: 1

The number of items to be indexed at one time.

ShowDotDot Default: 1

If set to 1, the .. folder (representing the previous folder) will be included. Otherwise the .. folder is ignored.

ShowFolder Default: 1

If set to 0, folders are ignored.

Note: To control the .. folder, use ShowDotDot above.

ShowFile Default: 1

If set to 0, files are ignored.

ShowHidden Default: 1

If set to 0, hidden files and folders are ignored.

ShowSystem Default: 0

If set to 1, protected operating system files are included.

HideExtensions Default: 0

If set to 1, file extensions are removed when used with Type=FileName.

Extensions

Semi-colon separated list of file extensions that limits the type of files to be included.

Example: If Extensions="jpg;png", only .jpg and .png files are included.

SortType Default: Name

Type of information to sort the entries by. Valid values are: Name, Size, Type, Date.

SortDateType Default: Modified

File and folder date entry to use for sorting when SortType=Date. Valid values are: Modified, Created, Accessed.

SortAscending Default: 1

If set to 1, the entries are sorted in ascending order. Otherwise a descending order is used.

WildcardSearch Default: *

Wildcards used to filter included files and/or folders. Standard * and ? characters can be used.

Child measure options

Index Default: 1

Index of the file or folder from the parent measure. This should not exceed the Count number in the parent measure. If it does, the items will wrap around. For example, if Count=8, Index=9 will be treated as Index=1.

IgnoreCount Default: 0

If set to 1, the Index will represent the actual index of the file or folder in the list. This is useful to display a particular file or folder at all times (like the .. folder).

Type Default: FolderPath

Type of information to obtain from the parent measure. Valid values are: FolderPath, FolderSize, FileCount, FolderCount, FileName, FileType, FileSize, FileDate, FilePath, and Icon.

Note: If Type=Icon, the full path of the icon file is returned. See IconPath below. This can be used with MeasureName or ImageName in an Image meter to display the icon.

DateType Default: Modified

The date entry to retrieve from the parent measure when Type=Date. Valid values are: Modified, Created, Accessed.

IconPath

Path of the folder to save icons when Type=Icon. If no path is given, the icons are saved in the skin folder and are named "iconX.ico", where "X" is the index number.

IconSize Default: Medium

Size of the icon to save. Valid values are: Small (for 16x16), Medium (for 32x32), Large (for 48x48), ExtraLarge (for 256x256).

Plugin Commands

Parent measure commands

Update

Updates the measure, reading the disk and recreating all values in the parent measure.

Example: LeftMouseUpAction=!CommandMeasure "ParentMeasureName" "Update"

PageUp

Decreases the current page count.

For example, if Count=8, and there are 25 files in the list, there is a total of 4 pages. If items 8-15 (page 2) are being displayed, the PageUp will decrease the page count by one changing the displayed items to items 0-7 (page 1).

Example: LeftMouseUpAction=!CommandMeasure "ParentMeasureName" "PageUp"

PageDown

Increases the page count.

IndexUp

Decreases the index by 1. This is useful for mouse scroll actions.

Example: MouseScrollUpAction=!CommandMeasure "ParentMeasureName" "IndexUp"

IndexDown

Increases the index by 1. This is useful for mouse scroll actions.

PreviousFolder

This will change the path to the folder one higher in the folder structure. Behaves like clicking on the .. folder.

Child measure commands

FollowPath

If the index referenced in the child measure is currently a folder, then the parent measure's Path is updated to the new path. If it is a file, then it is opened with the default Windows associated application. In order to better simulate Windows behavior, it is recommended that this command be used with a double-click action.

Example: LeftMouseDoubleClickAction=!CommandMeasure "ChildMeasureName" "FollowPath"

Open

This will open the file or folder that the index represents. If it is a folder, the folder is opened in Windows Explorer. If it is a file, then it is opened with the default Windows associated application. In order to better simulate Windows behavior, it is recommended that this command be used with a double-click action.

Example: LeftMouseDoubleClickAction=!CommandMeasure "ChildMeasureName" "Open"

Other commands

ContextMenu

Opens the context menu for the item represented by the measure. The context menu will appear at the current mouse location if the mouse is hovering over the skin, otherwise it will appear at the top left corner of the skin. This command can be used on a parent or child measure.

Example: !CommandMeasure "MeasureName" "ContextMenu"


Parent measures have the extra ability to open the context menu for a manually defined file/folder. See the example below.

Example: !CommandMeasure "ParentMeasureName" "ContextMenu C:\Some Folder\Some File.exe"

Note: Place quotes around the entire command and path. Extra quotes are not needed for paths that contain spaces.

Properties

Opens the property dialog for the item represented by the measure. This can be a parent or child measure.

Example: !CommandMeasure "MeasureName" "Properties"


Parent measures have the extra ability to open the property dialog for a manually defined file/folder. See the example below.

Example: !CommandMeasure "ParentMeasureName" "Properties C:\Some Folder\Some File.exe"

Note: Place quotes around the entire command and path. Extra quotes are not needed for paths that contain spaces.

Example

[Rainmeter]
Update=1000
MouseScrollUpAction=[!CommandMeasure mPath "IndexUp"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!CommandMeasure mPath "IndexDown"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Variables]
IconSize=Large

;----------------------------------------------------
; Styles
;----------------------------------------------------

[TextStyle]
FontColor=255,255,255,255
AntiAlias=1

[TextHighlight]
FontColor=150,150,255,255

[IconStyle]
X=5
Y=r
AntiAlias=1

[HighlightStyle]
SolidColor=0,0,0,1
X=5
Y=5R
W=380
H=([Index1Icon:H] > [Index1Info:H] ? [Index1Icon:H] : [Index1Info:H])
DynamicVariables=1
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "50,50,255,150"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor ""][!UpdateMeter #CURRENTSECTION#][!Redraw]

[InfoStyle]
X=5R
Y=r
Text="%1 #CRLF#%2 #CRLF#%3 "
AutoScale=1
AntiAlias=1

;----------------------------------------------------
; Measures
;----------------------------------------------------

[mPath]
Measure=Plugin
Plugin=FileView
Path="C:\"
Count=8

[mFolderCount]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FolderCount
Group=Children

[mFileCount]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileCount
Group=Children

[mFolderSize]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FolderSize
Group=Children

;----------------------------------------------------
; Index 1

[mIndex1Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=1
Group=Children

[mIndex1Size]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileSize
Index=1
Group=Children

[mIndex1Date]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileDate
Index=1
Group=Children

[mIndex1Icon]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=1
Group=Children

;----------------------------------------------------
; Index 2

[mIndex2Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=2
Group=Children

[mIndex2Size]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileSize
Index=2
Group=Children

[mIndex2Date]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileDate
Index=2
Group=Children

[mIndex2Icon]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=2
Group=Children

;----------------------------------------------------
; Index 3

[mIndex3Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=3
Group=Children

[mIndex3Size]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileSize
Index=3
Group=Children

[mIndex3Date]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileDate
Index=3
Group=Children

[mIndex3Icon]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=3
Group=Children

;----------------------------------------------------
; Index 4

[mIndex4Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=4
Group=Children

[mIndex4Size]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileSize
Index=4
Group=Children

[mIndex4Date]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileDate
Index=4
Group=Children

[mIndex4Icon]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=4
Group=Children

;----------------------------------------------------
; Index 5

[mIndex5Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=5
Group=Children

[mIndex5Size]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileSize
Index=5
Group=Children

[mIndex5Date]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileDate
Index=5
Group=Children

[mIndex5Icon]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=5
Group=Children

;----------------------------------------------------
; Index 6

[mIndex6Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=6
Group=Children

[mIndex6Size]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileSize
Index=6
Group=Children

[mIndex6Date]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileDate
Index=6
Group=Children

[mIndex6Icon]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=6
Group=Children

;----------------------------------------------------
; Index 7

[mIndex7Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=7
Group=Children

[mIndex7Size]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileSize
Index=7
Group=Children

[mIndex7Date]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileDate
Index=7
Group=Children

[mIndex7Icon]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=7
Group=Children

;----------------------------------------------------
; Index 8

[mIndex8Name]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileName
Index=8
Group=Children

[mIndex8Size]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileSize
Index=8
Group=Children

[mIndex8Date]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=FileDate
Index=8
Group=Children

[mIndex8Icon]
Measure=Plugin
Plugin=FileView
Path=[mPath]
Type=Icon
IconSize=#IconSize#
Index=8
Group=Children

;----------------------------------------------------
; Meters
;----------------------------------------------------

[Background]
Meter=Image
SolidColor=0,0,0,200
W=400
H=500

[PathTitle]
Meter=String
MeterStyle=TextStyle
Text=Path:

[Path]
Meter=String
MeasureName=mPath
MeterStyle=TextStyle | TextHighlight
Text="%1 "
X=R

[FolderCountTitle]
Meter=String
MeterStyle=TextStyle
X=0
Y=R
Text=Folders:

[FolderCount]
Meter=String
MeasureName=mFolderCount
MeterStyle=TextStyle | TextHighlight
X=R
Y=r

[FileCountTitle]
Meter=String
MeterStyle=TextStyle
X=10R
Y=r
Text=Files:

[FileCount]
Meter=String
MeasureName=mFileCount
MeterStyle=TextStyle | TextHighlight
X=R
Y=r

[FolderSizeTitle]
Meter=String
MeterStyle=TextStyle
X=10R
Y=r
Text=Size:

[FolderSize]
Meter=String
MeasureName=mFolderSize
MeterStyle=TextStyle | TextHighlight
X=R
Y=r
AutoScale=1

[Index1]
Meter=Image
MeterStyle=HighlightStyle
LeftMouseDoubleClickAction=[!CommandMeasure mIndex1Name "FollowPath"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Index1Icon]
Meter=Image
MeasureName=mIndex1Icon
MeterStyle=IconStyle

[Index1Info]
Meter=String
MeasureName=mIndex1Name
MeasureName2=mIndex1Size
MeasureName3=mIndex1Date
MeterStyle=TextStyle | InfoStyle

[Index2]
Meter=Image
MeterStyle=HighlightStyle
LeftMouseDoubleClickAction=[!CommandMeasure mIndex2Name "FollowPath"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Index2Icon]
Meter=Image
MeasureName=mIndex2Icon
MeterStyle=IconStyle

[Index2Info]
Meter=String
MeasureName=mIndex2Name
MeasureName2=mIndex2Size
MeasureName3=mIndex2Date
MeterStyle=TextStyle | InfoStyle

[Index3]
Meter=Image
MeterStyle=HighlightStyle
LeftMouseDoubleClickAction=[!CommandMeasure mIndex3Name "FollowPath"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Index3Icon]
Meter=Image
MeasureName=mIndex3Icon
MeterStyle=IconStyle

[Index3Info]
Meter=String
MeasureName=mIndex3Name
MeasureName2=mIndex3Size
MeasureName3=mIndex3Date
MeterStyle=TextStyle | InfoStyle

[Index4]
Meter=Image
MeterStyle=HighlightStyle
LeftMouseDoubleClickAction=[!CommandMeasure mIndex4Name "FollowPath"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Index4Icon]
Meter=Image
MeasureName=mIndex4Icon
MeterStyle=IconStyle

[Index4Info]
Meter=String
MeasureName=mIndex4Name
MeasureName2=mIndex4Size
MeasureName3=mIndex4Date
MeterStyle=TextStyle | InfoStyle

[Index5]
Meter=Image
MeterStyle=HighlightStyle
LeftMouseDoubleClickAction=[!CommandMeasure mIndex5Name "FollowPath"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Index5Icon]
Meter=Image
MeasureName=mIndex5Icon
MeterStyle=IconStyle

[Index5Info]
Meter=String
MeasureName=mIndex5Name
MeasureName2=mIndex5Size
MeasureName3=mIndex5Date
MeterStyle=TextStyle | InfoStyle

[Index6]
Meter=Image
MeterStyle=HighlightStyle
LeftMouseDoubleClickAction=[!CommandMeasure mIndex6Name "FollowPath"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Index6Icon]
Meter=Image
MeasureName=mIndex6Icon
MeterStyle=IconStyle

[Index6Info]
Meter=String
MeasureName=mIndex6Name
MeasureName2=mIndex6Size
MeasureName3=mIndex6Date
MeterStyle=TextStyle | InfoStyle

[Index7]
Meter=Image
MeterStyle=HighlightStyle
LeftMouseDoubleClickAction=[!CommandMeasure mIndex7Name "FollowPath"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Index7Icon]
Meter=Image
MeasureName=mIndex7Icon
MeterStyle=IconStyle

[Index7Info]
Meter=String
MeasureName=mIndex7Name
MeasureName2=mIndex7Size
MeasureName3=mIndex7Date
MeterStyle=TextStyle | InfoStyle

[Index8]
Meter=Image
MeterStyle=HighlightStyle
LeftMouseDoubleClickAction=[!CommandMeasure mIndex8Name "FollowPath"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]

[Index8Icon]
Meter=Image
MeasureName=mIndex8Icon
MeterStyle=IconStyle

[Index8Info]
Meter=String
MeasureName=mIndex8Name
MeasureName2=mIndex8Size
MeasureName3=mIndex8Date
MeterStyle=TextStyle | InfoStyle

[PageUp]
Meter=String
MeterStyle=TextStyle
FontSize=15
X=5
Y=10R
Text=Page Up
LeftMouseDoubleClickAction=[!CommandMeasure mPath "PageUp"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "50,50,255,150"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor ""][!UpdateMeter #CURRENTSECTION#][!Redraw]

[PageDown]
Meter=String
MeterStyle=TextStyle
FontSize=15
X=10R
Y=r
Text=Page Down
LeftMouseDoubleClickAction=[!CommandMeasure mPath "PageDown"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "50,50,255,150"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor ""][!UpdateMeter #CURRENTSECTION#][!Redraw]

[PreviousFolder]
Meter=String
MeterStyle=TextStyle
FontSize=15
X=10R
Y=r
Text=Previous Folder
LeftMouseDoubleClickAction=[!CommandMeasure mPath "PreviousFolder"][!UpdateMeasure mPath][!UpdateMeasureGroup Children][!UpdateMeter *][!Redraw]
MouseOverAction=[!SetOption #CURRENTSECTION# SolidColor "50,50,255,150"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# SolidColor ""][!UpdateMeter #CURRENTSECTION#][!Redraw]