It is currently April 26th, 2024, 1:15 am

Open first File in Folder?

Get help with creating, editing & fixing problems with skins
milt
Posts: 13
Joined: October 23rd, 2022, 2:34 am

Open first File in Folder?

Post by milt »

Hello,

Looking for help with this idea I would like to workout. Here is the "Button Command"

ButtonCommand=["D:\Play List M&E\21p.srt"]["D:\Play List M&E\21p.mp4"]

It works just find. But the file names change every day. So I wanted to know if there is anyway for it just to open the first file in the folder for each type of file?


Any help would be great.
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Open first File in Folder?

Post by tass_co »

milt wrote: October 23rd, 2022, 2:55 am Hello,

Looking for help with this idea I would like to workout. Here is the "Button Command"

ButtonCommand=["D:\Play List M&E\21p.srt"]["D:\Play List M&E\21p.mp4"]

It works just find. But the file names change every day. So I wanted to know if there is anyway for it just to open the first file in the folder for each type of file?


Any help would be great.

I haven't tried the code but I think it should be like this.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Path="D:\Play List M&E"

[MeaFolder]
Measure=Plugin
Plugin=FileView
Path=#Path#
ShowDotDot=0
ShowFolder=0
SortType=Date
SortDateType=Created
SortAscending=1
Count=2
Extensions="mp4;srt"
DynamicVariables=1
UpdateDivider=60

[MeaChild1]
Measure=Plugin
Plugin=FileView
Path=[MeaFolder]
Type=FilePath
Index=1
DynamicVariables=1
UpdateDivider=60

[MeaChild2]
Measure=Plugin
Plugin=FileView
Path=[MeaFolder]
Type=FilePath
Index=2
DynamicVariables=1
UpdateDivider=60

[MtrFileNames]
Meter=String
MeasureName=MeaChild1
MeasureName2=MeaChild2
X=0
Y=0
W=200
H=60
StringStyle=Normal
StringAlign=Center
FontSize=12
FontColor=255,255,255
ClipString=1
AntiAlias=1
Text=%1#CRLF#%2
LeftMouseUpAction=[MeaChild1][MeaChild2]
DynamicVariables=1
I don't know where i going from here, but i promise it won't be boring... :great:
milt
Posts: 13
Joined: October 23rd, 2022, 2:34 am

Re: Open first File in Folder?

Post by milt »

First of all, Thank You for Your reply tass_co.

I am very new to Rainmeter just so you know. So I have a few questions?

1: This shows the first 2 MP4 files, need fix it to show 1st MP4 and Srt
2: It only shows file names on desktop no Launcher to open the files

Thanks Again for You Help.
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Open first File in Folder?

Post by tass_co »

milt wrote: October 23rd, 2022, 2:05 pm First of all, Thank You for Your reply tass_co.

I am very new to Rainmeter just so you know. So I have a few questions?

1: This shows the first 2 MP4 files, need fix it to show 1st MP4 and Srt
2: It only shows file names on desktop no Launcher to open the files

Thanks Again for You Help.
It should work this way

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Path="D:\Play List M&E"

[MeaMP4]
Measure=Plugin
Plugin=FileView
Path=#Path#
ShowDotDot=0
ShowFolder=0
SortType=Date
SortDateType=Created
SortAscending=0
Extensions="mp4;srt"
Count=2
DynamicVariables=1
UpdateDivider=60

[MeaChild1]
Measure=Plugin
Plugin=FileView
Path=[MeaMP4]
Type=FileName
Index=1
DynamicVariables=1
UpdateDivider=60

[MeaChild2]
Measure=Plugin
Plugin=FileView
Path=[MeaMP4]
Type=FileName
Index=2
DynamicVariables=1
UpdateDivider=60

[MtrFileNames]
Meter=String
MeasureName=MeaChild1
MeasureName2=MeaChild2
X=10
Y=0
W=300
H=60
StringStyle=Normal
StringAlign=Left
FontSize=10
FontColor=255,255,255
ClipString=1
AntiAlias=1
Text=%1#CRLF#%2
LeftMouseUpAction=["[MeaChild1]"]["[MeaChild2]"]
DynamicVariables=1
FileView plugin sorts by file creation date. Because of this, some problems may occur.
For example; If the file creation order is 1.SRT 2. MP4 (by date), there should be no problem. But if 1.SRT is 2.SRT, it will be a problem.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open first File in Folder?

Post by balala »

tass_co wrote: October 23rd, 2022, 2:38 pm FileView plugin sorts by file creation date. Because of this, some problems may occur.
Sorry, but not absolutely necessary. It can sort the files either by date (in which case the default sort is done by the date of modification, but this can be changed as well), but can also sort by name, size or type of files, depending on what are you setting into the SortType option of the parent measure.
milt wrote: October 23rd, 2022, 2:55 am So I wanted to know if there is anyway for it just to open the first file in the folder for each type of file?
I assume you want to get the first file of each type, by the name of those files. But am I correct, when assuming this? Or need the first file after another sorting criterium?
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Open first File in Folder?

Post by tass_co »

balala wrote: October 23rd, 2022, 2:50 pm Sorry, but not absolutely necessary. It can sort the files either by date (in which case the default sort is done by the date of modification, but this can be changed as well), but can also sort by name, size or type of files, depending on what are you setting into the SortType option of the parent measure.
There is already an existing sorting. What I am talking about in the example is the file type. If it is in the form of 1.srt, 2.mp4, 3.srt, 4.mp4... there will be no problem. The situation I'm trying to describe applies to 1.srt, 2.srt, 3.mp4
The code you need; choose one srt file, then one mp4...etc.
I don't know where i going from here, but i promise it won't be boring... :great:
milt
Posts: 13
Joined: October 23rd, 2022, 2:34 am

Re: Open first File in Folder?

Post by milt »

Thank You for Your reply balala,

All files are in the same folder and would be in the following order:

01a.mp4
01a.srt
01p.mp4
01p.srt
02a.mp4
02a.srt
02p.mp4
02p.srt
and so on......

What I am trying to do is open (with a launcher) the 1st two files (01a.mp4 and 01a.srt) so I can hear and read along.

Then some how delete them with a differ launcher so the next time it would look like this:

01p.mp4
01p.srt
02a.mp4
02a.srt
02p.mp4
02p.srt
and so on.....
("01a.mp4 and 01a.srt" files are gone)

Then the next time I open (with a launcher) it would open the 1st two files (01p.mp4 and 01p.srt)

And so.....

Repeating

This a daily reading, I will be using Winamp for MP4 and Penguin Subtitles for SRT

Hope this makes sense of what I am trying to do.

Thank You again.
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Open first File in Folder?

Post by tass_co »

milt wrote: October 23rd, 2022, 4:14 pm Thank You for Your reply balala,

All files are in the same folder and would be in the following order:

01a.mp4
01a.srt
01p.mp4
01p.srt
02a.mp4
02a.srt
02p.mp4
02p.srt
and so on......

What I am trying to do is open (with a launcher) the 1st two files (01a.mp4 and 01a.srt) so I can hear and read along.

Then some how delete them with a differ launcher so the next time it would look like this:

01p.mp4
01p.srt
02a.mp4
02a.srt
02p.mp4
02p.srt
and so on.....
("01a.mp4 and 01a.srt" files are gone)

Then the next time I open (with a launcher) it would open the 1st two files (01p.mp4 and 01p.srt)

And so.....

Repeating

This a daily reading, I will be using Winamp for MP4 and Penguin Subtitles for SRT

Hope this makes sense of what I am trying to do.

Thank You again.
Now things change!
In such a case, it will be sufficient for you to find only the first 2 files by name.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Path="D:\Play List M&E"

[MeaMP4]
Measure=Plugin
Plugin=FileView
Path=#Path#
ShowDotDot=0
ShowFolder=0
SortType=Name
;SortDateType=Created
SortAscending=1
Extensions="mp4;srt"
Count=2
DynamicVariables=1
UpdateDivider=60

[MeaChild1]
Measure=Plugin
Plugin=FileView
Path=[MeaMP4]
Type=FilePath
Index=1
DynamicVariables=1
UpdateDivider=60

[MeaChild2]
Measure=Plugin
Plugin=FileView
Path=[MeaMP4]
Type=FilePath
Index=2
DynamicVariables=1
UpdateDivider=60

[MtrFileNames]
Meter=String
MeasureName=MeaChild1
MeasureName2=MeaChild2
X=10
Y=0
W=300
H=60
StringStyle=Normal
StringAlign=Left
FontSize=10
FontColor=255,255,255
ClipString=1
AntiAlias=1
Text=%1#CRLF#%2
LeftMouseUpAction=["[MeaChild1]"]["[MeaChild2]"]
DynamicVariables=1
I don't know where i going from here, but i promise it won't be boring... :great:
milt
Posts: 13
Joined: October 23rd, 2022, 2:34 am

Re: Open first File in Folder?

Post by milt »

Thank You Again tass_co.

It works perfect!!!!
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Open first File in Folder?

Post by tass_co »

milt wrote: October 23rd, 2022, 5:44 pm Thank You Again tass_co.

It works perfect!!!!
:great:
I don't know where i going from here, but i promise it won't be boring... :great: