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] |
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] |
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] |
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 appropriate UpdateDivider.
[MeasureFolder] |
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 This PC (formerly 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. Nested variables cannot be used as well.
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 withType=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, ifCount=8
,Index=9
will be treated asIndex=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.
Information for path returned by the parent measure
FolderPath
: Path of folder returned in parent Path, with trailing "\"FolderSize
: Size in bytes of folder returned in parent PathFileCount
: Count of files in folder returned in parent PathFolderCount
: Count of folders in folder returned in parent Path
Information for object returned by the child Index number
FileName
: Name of indexed object, folder or fileFileType
: Extension only with no "." for indexed file. Empty with folderFileSize
: Size in bytes of indexed file. Empty with folderFileDate
: System date of indexed object, folder or file. SeeDateType
for possible date typesFilePath
: Full path and name of indexed object, folder or file. No trailing "\" with foldersPathToFile
: Full path up to indexed object, folder or file, with trailing "\")Icon
: Full path and name of icon extracted from indexed object, folder or file
Note: If
Type=Icon
, the full path of the icon file is returned. See IconPath below. This can be used withMeasureName
orImageName
in an Image meter to display the icon. DateType
Default:Modified
-
The date entry to retrieve from the parent measure when
Type=FileDate
. Valid values are:Modified
,Created
,Accessed
. IconPath
-
Path and filename of the location (relative to the skin 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, thePageUp
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] |