It is currently May 2nd, 2024, 6:36 am

[SOLVED] How to get local image link from txt.file

Get help with creating, editing & fixing problems with skins
Nachtschade
Posts: 24
Joined: August 1st, 2017, 10:02 pm

Re: How to get local image link from txt.file

Post by Nachtschade »

Ah, I wasn't aware of the log feature.

It says:

Code: Select all

ERRO (19:36:56.332) FlagView\FlagView.ini: ImageName: Unable to open: B:\Data Empire\Afbeeldingen\Flags\ico\Croatia.ico
Tried to simplify the path, still the same:

Code: Select all

ERRO (19:38:55.453) FlagView\FlagView.ini: ImageName: Unable to open: A:\Croatia.ico
User avatar
balala
Rainmeter Sage
Posts: 16194
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to get local image link from txt.file

Post by balala »

Nachtschade wrote:Ah, I wasn't aware of the log feature.

It says:

Code: Select all

ERRO (19:36:56.332) FlagView\FlagView.ini: ImageName: Unable to open: B:\Data Empire\Afbeeldingen\Flags\ico\Croatia.ico
Tried to simplify the path, still the same:

Code: Select all

ERRO (19:38:55.453) FlagView\FlagView.ini: ImageName: Unable to open: A:\Croatia.ico
In this case, let's see how the Image meter works with a well specified file name. Replace the MeasureName option of the [MeterImage] meter with ImageName=A:\Croatia.ico (or ImageName=B:\Data Empire\Afbeeldingen\Flags\ico\Croatia.ico, or the appropriate path). When you refresh the skin, the image should have to appear instantly. Does it?
Nachtschade
Posts: 24
Joined: August 1st, 2017, 10:02 pm

Re: How to get local image link from txt.file

Post by Nachtschade »

So I changed this line:

Code: Select all

MeasureName=ImageName=A:\Croatia.ico
Still not showing up but now the log says:
NOTE (20:34:00.015) FlagView\FlagView.ini: Refreshing skin
With no error.
Nachtschade
Posts: 24
Joined: August 1st, 2017, 10:02 pm

Re: How to get local image link from txt.file

Post by Nachtschade »

ah wait.

I changed it to:

Code: Select all

ImageName=A:\Croatia.ico
Instead of

Code: Select all

MeasureName=ImageName=A:\Croatia.ico
And now the image does indeed show up.

Sorry for that.
User avatar
balala
Rainmeter Sage
Posts: 16194
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to get local image link from txt.file

Post by balala »

Ok, I just wanted to fix the error. But now I think it is.
Let's make a few more tries. Starting from the previously sent code, replace the MeasureName option of the [MeterImage] meter with ImageName=MeasurePath (take care that's the whole option, don1t add more).
Nachtschade
Posts: 24
Joined: August 1st, 2017, 10:02 pm

Re: How to get local image link from txt.file

Post by Nachtschade »

The error log results in this:

Code: Select all

ERRO (22:00:22.329) FlagView\FlagView.ini: ImageName: Unable to open: A:\Croatia.ico

NOTE (22:00:22.880) FlagView\FlagView.ini: Refreshing skin
ERRO (22:00:22.882) FlagView\FlagView.ini: ImageName: Unable to open: A:\Portable Apps\Rainmeter\Skins\FlagView\MeasurePath.png
User avatar
balala
Rainmeter Sage
Posts: 16194
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to get local image link from txt.file

Post by balala »

Sorry, I just discovered an issue in my previous piece of code. Instead of the ImageName=MeasurePath option, try ImageName=[MeasurePath]. This option, in this form also requires to add a DyanmciVariables=1 option to the [MeterImage] meter. Don 't forget nor that one.
Nachtschade
Posts: 24
Joined: August 1st, 2017, 10:02 pm

Re: How to get local image link from txt.file

Post by Nachtschade »

Still no dice.

But the log now only says

Code: Select all

ERRO (23:04:16.350) FlagView\FlagView.ini: ImageName: Unable to open: A:\Croatia.ico
again.
Nachtschade
Posts: 24
Joined: August 1st, 2017, 10:02 pm

Re: How to get local image link from txt.file

Post by Nachtschade »

So, interesting development. I decided to create a new .txt file that contains the path to the image. And now it does suddenly does work. Seems not all .txt files are equal.
Nachtschade
Posts: 24
Joined: August 1st, 2017, 10:02 pm

Re: How to get local image link from txt.file

Post by Nachtschade »

Unfortunately though it seems that the script I'm using to build the .txt file does something to the .txt that makes it not work with Rainmeter.

The script i'm using is a MediaMonkey script. The goal of the script is to get the country of origin of an Artist. I've tagged countries in one of MediaMonkey's custom tags. (Custom1) I'm running this script twice, once to simply get the countryname so I can use a Rainmeter skin to show the countryname as part of a now playing skin (the now playing plugin cannot read MediaMonkey custom tags so it's a workaround.) Reading and displaying the name is working fine. But I wanted to show the countryflag as well.

This is the script I'm using:

Code: Select all

' OutputFlagFile.vbs
    ' Write the current playing track and artist to a text file
    option explicit

    sub OutputFlagFile

       dim objFSO, objTextFile, strTextFilePath, strTrack, strArtist, strCustom1

       'SET THIS TO LOCATION OF FILE
      strTextFilePath = "A:\Portable Apps\MediaMonkey\npcountryflag.txt"


       'Get the artist/track
       strTrack = SDB.Player.CurrentSong.Title
       strArtist = SDB.Player.CurrentSong.Artist.Name
       strCustom1 = SDB.Player.CurrentSong.Custom1

       'Open the file & write
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      If (objfso.FileExists(strTextFilePath)) Then
           Set objTextFile = objFSO.OpenTextFile(strTextFilePath,2)
      Else
         Set objTextFile = objFSO.CreateTextFile(strTextFilePath,2)
      End If

     On Error Resume Next
     
     If strArtist = "" Then 
      objTextFile.WriteLine ""
     Else
     objTextFile.WriteLine "B:\Data Empire\Afbeeldingen\Flags\ico\" & strCustom1 & 

".ico"
      End If
     
     If Err.Number <> 0 Then
      objTextFile.WriteLine "Error: Unicode Text"
      Err.Clear
      End If
       
    
       'close the file   
       objTextFile.Close
       

    end sub
Written by MediaMonkey users and found here.

I'm using on of the two versions in the last post of that thread. I'm using the version captioned "Version for OBS txt plug-in (no unicode support)". I am not knowledgeable about what it means but when trying the other version didn't work for showing the countryname and both versions don't work for showing flag images.

Different errors though. The first version shows the error I gave before
ERRO (00:48:01.867) FlagView\FlagView.ini: ImageName: Unable to open: B:\Data Empire\Afbeeldingen\Flags\ico\Montenegro.ico
and the second version gives this error:
ERRO (00:47:59.371) FlagView\FlagView.ini: ImageName: Unable to open: A:\Portable Apps\Rainmeter\Skins\FlagView\��B.png
Now, like I said earlier; when creating a new .txt file from scratch and adding the path to the image to it it works fine. So it has to have something to do with the MM script that writes the .txt file.