It is currently March 29th, 2024, 9:40 am

measure name empty

Get help with creating, editing & fixing problems with skins
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

measure name empty

Post by Judian81 »

hey hello rainmeter people,

i have something i can not found out. i am missing something.

Code: Select all

[Index3Icon]
Meter=Image
ImageName=[mLuaScript3]
MeterStyle=IconStyle
Group=Index3
PreserveAspectRatio=1
RightMouseUpAction=[!DisableMouseAction Background "MouseLeaveAction"][!CommandMeasure "mIndex3Name" "ContextMenu"]
DynamicVariables=1
this is de meter that have to get the file path.

Code: Select all

[mLuaScript3]
Measure=Script
ScriptFile="#CURRENTPATH#Script\readfile.lua"
FileToRead="#vFilePathRead#"
DynamicVariables=1
Unable to load file. filename = 0.png

Code: Select all

[button]
Meter=String
Y=50
X=10
W=100
H=100
FontSize=12
FontColor=White
Text="Press Me"
LeftMouseUpAction=[!SetVariable vFilePathRead "#CURRENTPATH#Temp\[mThumbnailPath][mIndex3Name].txt"][!UpdateMeasure mLuaScript3][!UpdateMeter Index3Icon][!UpdateMeter text][!Refresh]
ToolTipText="#CURRENTPATH#Temp\[mThumbnailPath][mIndex3Name].txt"
DynamicVariables=1
tooltiptext is the full path include the filename that is correct.

Code: Select all

[text]
Meter=String
MeasureName=mLuaScript3
Y=150
X=100
FontSize=12
FontColor=White
DynamicVariables=1
Text=%1
the output is 0

it is if the filename is disapearing some how.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: measure name empty

Post by death.crafter »

Judian81 wrote: November 13th, 2021, 8:27 am hey hello rainmeter people,

i have something i can not found out. i am missing something.

Code: Select all

[Index3Icon]
Meter=Image
ImageName=[mLuaScript3]
MeterStyle=IconStyle
Group=Index3
PreserveAspectRatio=1
RightMouseUpAction=[!DisableMouseAction Background "MouseLeaveAction"][!CommandMeasure "mIndex3Name" "ContextMenu"]
DynamicVariables=1
this is de meter that have to get the file path.

Code: Select all

[mLuaScript3]
Measure=Script
ScriptFile="#CURRENTPATH#Script\readfile.lua"
FileToRead="#vFilePathRead#"
DynamicVariables=1
Unable to load file. filename = 0.png

Code: Select all

[button]
Meter=String
Y=50
X=10
W=100
H=100
FontSize=12
FontColor=White
Text="Press Me"
LeftMouseUpAction=[!SetVariable vFilePathRead "#CURRENTPATH#Temp\[mThumbnailPath][mIndex3Name].txt"][!UpdateMeasure mLuaScript3][!UpdateMeter Index3Icon][!UpdateMeter text][!Refresh]
ToolTipText="#CURRENTPATH#Temp\[mThumbnailPath][mIndex3Name].txt"
DynamicVariables=1
tooltiptext is the full path include the filename that is correct.

Code: Select all

[text]
Meter=String
MeasureName=mLuaScript3
Y=150
X=100
FontSize=12
FontColor=White
DynamicVariables=1
Text=%1
the output is 0

it is if the filename is disapearing some how.
What is the lua? And I can't quite figure out what you're tryna do here.
from the Realm of Death
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: measure name empty

Post by Judian81 »

death.crafter wrote: November 13th, 2021, 8:44 am What is the lua? And I can't quite figure out what you're tryna do here.
i am building a cache folder. if an extension is a video file. i extract a frame and save that in the cache folder.
on the same time i make a txt file to the frame icon.
if it is a mp3 file i extract that icon just 1 time. and make a text file in the cache folder. with the link to that icon file.
lua script has to read the txt file. and on this way i know the location of the mp3 icon file.

vFilePathRead="C:\Users\*\Documents\Rainmeter\Skins\FolderView\Folder7\Temp\C\ProgramData\Cool\1.0.mp3.txt"

lua has to read this file. C:\Users\*\Documents\Rainmeter\Skins\FolderView\Folder7\Temp\..\Custom Icons\.mp3.png
and now we know how to load the image.


it does work if i put the link into the variable vFilePathRead

but i do not get it working if i do it dynamic. with SetVariable.

this is how it looks like.

wow.png
You do not have the required permissions to view the files attached to this post.
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: measure name empty

Post by Judian81 »

Code: Select all

[mLuaScript3]
Measure=Script
ScriptFile="#CURRENTPATH#Script\readfile.lua"
FileToRead="#vFilePathRead#"
DynamicVariables=1
vFilePathRead has to be changed. then luascript3 had to read the file again and pass the link to the image.
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: measure name empty

Post by Judian81 »

ow btw the lua script what you ask for.

Code: Select all

function Initialize()

	sFileToRead = SELF:GetOption('FileToRead')
	
end

function Update()

	hReadingFile = io.open(sFileToRead)
	if not hReadingFile then
		print('LuaTextFile: unable to open file at ' .. sFileToRead)
		return
	end
	
	sAllText = hReadingFile:read("*all")
	
	sAllText = string.gsub(sAllText, "\t", "     ")
	
	io.close(hReadingFile)
	
	return tostring(sAllText)	
	
end
lua script is doing well.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: measure name empty

Post by death.crafter »

Judian81 wrote: November 13th, 2021, 9:06 am i am building a cache folder. if an extension is a video file. i extract a frame and save that in the cache folder.
on the same time i make a txt file to the frame icon.
if it is a mp3 file i extract that icon just 1 time. and make a text file in the cache folder. with the link to that icon file.
lua script has to read the txt file. and on this way i know the location of the mp3 icon file.

vFilePathRead="C:\Users\*\Documents\Rainmeter\Skins\FolderView\Folder7\Temp\C\ProgramData\Cool\1.0.mp3.txt"

lua has to read this file. C:\Users\*\Documents\Rainmeter\Skins\FolderView\Folder7\Temp\..\Custom Icons\.mp3.png
and now we know how to load the image.


it does work if i put the link into the variable vFilePathRead

but i do not get it working if i do it dynamic. with SetVariable.

this is how it looks like.

wow.png
That's a bit if a stretch. Why don't you just write to one file? You can either go for a key value strategy or section value strategy. e.g.

Code: Select all

[path\to\file1]
path\to\icon_cache1

[path\to\file2]
path\to\icon_cache2
This will be easier to write and read. There will be problems cleaning up, but I don't think it would be that of a cliché.
from the Realm of Death
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: measure name empty

Post by Judian81 »

death.crafter wrote: November 13th, 2021, 10:43 am This will be easier to write and read. There will be problems cleaning up, but I don't think it would be that of a cliché.
i created a bat file. and now i have made a list in 1 file.
but the thing is. then i have to use a search function in lua to get the the picture that must be used with the corrensponding file.

now the answer to my question i have solved.

Code: Select all

[Index8Icon]
Meter=Image
ImageName="[mLuaScript8]"
OnUpdateAction=[!SetVariable "vFilePathRead8" "#CURRENTPATH#Temp\[mThumbnailPath][mIndex8Name].png.txt][!CommandMeasure "mLuaScript8" "Initialize()]
MeterStyle=IconStyle
Group=Index8
PreserveAspectRatio=1
RightMouseUpAction=[!DisableMouseAction Background "MouseLeaveAction"][!CommandMeasure "mIndex8Name" "ContextMenu"]

[mLuaScript8]
Measure=Script
ScriptFile="#CURRENTPATH#Script\readfile.lua"
FileToRead=#vFilePathRead8#
DynamicVariables=1
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: measure name empty

Post by Judian81 »

death.crafter wrote: November 13th, 2021, 10:43 am There will be problems cleaning up, but I don't think it would be that of a cliché.



hey death.crafter,

the cliche will be there for real. maby with a time measure ment in the batch will update the exsisting files.
i just want to build a cach folder. so maby when time is changed i will over write the cache,
i use ffmpeg for different things. so i also made something for the rest of the icons. i just do not want to over write every time i enter a folder.

thanks for everything you do. :)
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: measure name empty

Post by death.crafter »

Judian81 wrote: November 16th, 2021, 6:20 pm hey death.crafter,

the cliche will be there for real. maby with a time measure ment in the batch will update the exsisting files.
i just want to build a cach folder. so maby when time is changed i will over write the cache,
i use ffmpeg for different things. so i also made something for the rest of the icons. i just do not want to over write every time i enter a folder.

thanks for everything you do. :)
The problem will be with cache management, yes. But it won't be a cliche as in, you can set up a proper management system. You are pretty good with c++ I take it. So, I assume you know a fair bit of powershell, or even if you don't, you can grab it easily. There is a plugin called powershellrm you can use to do the swiftly.

Basically, this would include, checking for files using Get-ChildItem. Then reading your cache file, using Get-Content. See if there is existing data about the files, if not create one and add it to the cache data and rewrite the cache data.

I can set up a system, but the problem is you may not like it or it may not suite your work flow.

Or stick with what you have. May be that is the best way to do it.
from the Realm of Death
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: measure name empty

Post by Judian81 »

death.crafter wrote: November 16th, 2021, 6:32 pm Or stick with what you have. May be that is the best way to do it.
i think i am going to stick whit what i have build so far. but you opend my eyes about time mannagment in the cach file database.
but it is not wrong to know about power shel and that kind of stuff. i life to be a programmer.