Hello,
I'm building a very simple skin that needs to display a single image on my desktop. However the image to be displayed changes. The path to the image that should be displayed at a specific time is automatically updated into a .txt file by another program. The .txt file only has a single line with the path, no other content.
What do I need to do to make this dynamic?
Currently the skin config simply reads:
ImageName=C:\image.ico
And it needs to refer to C:\.txt file that contains the path to the actual image.
Hope I explained that well enough. Thanks for reading.
It is currently March 29th, 2024, 12:25 pm
[SOLVED] How to get local image link from txt.file
-
- Posts: 24
- Joined: August 1st, 2017, 10:02 pm
[SOLVED] How to get local image link from txt.file
Last edited by Nachtschade on May 3rd, 2018, 11:40 am, edited 1 time in total.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to get local image link from txt.file
Yep, you probably did.Nachtschade wrote:Hope I explained that well enough.
Here is a short code:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
[MeasurePath]
Measure=WebParser
UpdateRate=900
Url=file://PATH-TO-THE-.txt-FILE
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!ShowMeter "MeterImage"]
[MeterImage]
Meter=Image
MeasureName=MeasurePath
X=0
Y=0
W=120
H=90
PreserveAspectRatio=1
Hidden=1
[MeterPath]
MeasureName=MeasurePath
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=Left
AntiAlias=1
Text=Path: %1
I added the [MeterPath] meter to have something on the skin, just in case if something is going wrong and the image doesn't appear. If everything is ok, you can remove this meter.
Please let me know if this code works as you intended.
-
- Posts: 24
- Joined: August 1st, 2017, 10:02 pm
Re: How to get local image link from txt.file
Thank you.
It's not working yet though.
I get this as a result:
Which is the correct path to the image that is in the text file that the skin must read. The actual image however doesn't show up.
It's not working yet though.
I get this as a result:
Which is the correct path to the image that is in the text file that the skin must read. The actual image however doesn't show up.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to get local image link from txt.file
For me it is. Please post the Croatia.ico file, to can check.Nachtschade wrote:The actual image however doesn't show up.
-
- Posts: 24
- Joined: August 1st, 2017, 10:02 pm
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to get local image link from txt.file
It does work for me. Perfectly. The image is shown up.Nachtschade wrote:This is the file: https://www107.zippyshare.com/v/HSfrjLyq/file.html
Please pack the whole config and upload it.
-
- Posts: 24
- Joined: August 1st, 2017, 10:02 pm
Re: How to get local image link from txt.file
The .ini, Basically a full copy of your code, with the link to the .txt file added.
https://www6.zippyshare.com/v/lODBD0ld/file.html
Also the .txt file itself:
https://www6.zippyshare.com/v/eL2Ld8Y9/file.html
I'm sure it must be something obvious that I'm doing wrong because I fail at being smart.
https://www6.zippyshare.com/v/lODBD0ld/file.html
Also the .txt file itself:
https://www6.zippyshare.com/v/eL2Ld8Y9/file.html
I'm sure it must be something obvious that I'm doing wrong because I fail at being smart.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to get local image link from txt.file
Are you sure about the paths of the Croatia.ico and npcountryflag.txt files? A: and B: today are very weird places for those files (however if the appropriate file path is shown up by the String meter, I think they are ok).Nachtschade wrote:The .ini, Basically a full copy of your code, with the link to the .txt file added.
https://www6.zippyshare.com/v/lODBD0ld/file.html
Also the .txt file itself:
https://www6.zippyshare.com/v/eL2Ld8Y9/file.html
I'm sure it must be something obvious that I'm doing wrong because I fail at being smart.
But I asked for the whole config packed, not just two files. Sometimes it is much better. Please pack the Config (the folder in the Skins folder, which contains the FlagVies.ini file) and upload that one.
-
- Posts: 24
- Joined: August 1st, 2017, 10:02 pm
Re: How to get local image link from txt.file
Yeah, the paths are most certainly okay, including the driveletters.
I'm not sure I understand about the 'package'? In the skins folder there is a folder called 'flagview' which contains one file called 'flagview.ini'. I send you the file. I could of course use winzip to 'package' the folder with the one file and send that but is that really what you mean?
I'm not sure I understand about the 'package'? In the skins folder there is a folder called 'flagview' which contains one file called 'flagview.ini'. I send you the file. I could of course use winzip to 'package' the folder with the one file and send that but is that really what you mean?
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to get local image link from txt.file
No, if there is just one single file (FlagView.ini) no need to pack the config. I thought maybe there are more.Nachtschade wrote:I'm not sure I understand about the 'package'? In the skins folder there is a folder called 'flagview' which contains one file called 'flagview.ini'. I send you the file. I could of course use winzip to 'package' the folder with the one file and send that but is that really what you mean?
But if the image isn't shown up, I don't know what to say. Open the log and refresh the skin. Does any message appears?