I'm using a spotify skin, in the .ini I get
[Variables]
ARTIST = ***; (artist playing)
I've a folder with many artist named files (extension .vbs)
I want to open that files when the artist variable is equal to the one of the file inside that folder
How can I do it, I don't know how to use that variable in .lua
I was seeing this but I don't understand much using the variables
https://docs.rainmeter.net/snippets/read-write-file/
is what appears in this video, in the upper left, so that it changes automatically depending on what I'm listening to
https://www.youtube.com/watch?v=NX7ni1iftSo
PS: with MouseOverAction=!Execute ["C:\Users\Alexis\Documents\Rainmeter\Skins\Effect\Music\#ARTIST#.vbs"], this works, but I want it to be automatic
It is currently April 27th, 2024, 4:38 pm
Condition syntax and Read a File
-
- Posts: 3
- Joined: May 22nd, 2020, 4:05 am
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Condition syntax and Read a File
Hi evil_dark_lxs
You should have a measure to get Artist name from Spotify. What if you set OnChangeAction= option to the measure? For example, OnChangeAction=["C:\Users\Alexis\Documents\Rainmeter\Skins\Effect\Music\#ARTIST#.vbs"].
But honestly, I am not sure this action does work or not, because I can't actually examine your code... sorry if I am misunderstanding.
Ps. !Execute bang is deprecated in current Rainmeter.
You should have a measure to get Artist name from Spotify. What if you set OnChangeAction= option to the measure? For example, OnChangeAction=["C:\Users\Alexis\Documents\Rainmeter\Skins\Effect\Music\#ARTIST#.vbs"].
But honestly, I am not sure this action does work or not, because I can't actually examine your code... sorry if I am misunderstanding.
Ps. !Execute bang is deprecated in current Rainmeter.
-
- Posts: 3
- Joined: May 22nd, 2020, 4:05 am
Re: Condition syntax and Read a File
mak_kawa wrote: ↑May 23rd, 2020, 4:30 am Hi evil_dark_lxs
You should have a measure to get Artist name from Spotify. What if you set OnChangeAction= option to the measure? For example, OnChangeAction=["C:\Users\Alexis\Documents\Rainmeter\Skins\Effect\Music\#ARTIST#.vbs"].
But honestly, I am not sure this action does work or not, because I can't actually examine your code... sorry if I am misunderstanding.
Ps. !Execute bang is deprecated in current Rainmeter.
it worked for me
thk u!!!!
-
- Rainmeter Sage
- Posts: 16177
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Condition syntax and Read a File
Yes, but this is working only if there is a bang to set the artist as a variable, something like for instance OnChangeAction=[!SetVariable ARTIST "[MeasureArtist]"], on the measure returning the artist's name (in my example the name of this measure is [MeasureArtist]). Neither Rainmeter, nor the NowPlaying measure are not setting the ARTIST variable, which could be used into the above OnChangeAction.
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Condition syntax and Read a File
Hi balala
Ah... you are right. I too was wondering where/how the variable ARTIST is set, but of course i don't know. So, I have assumed by definition that evil_dark_lxs specified/set the ARTIST variable somewhere in the skin.
My another idea is...OnChangeAction=["C:\Users\Alexis\Documents\Rainmeter\Skins\Effect\Music\[MeasureArtist].vbs", direct reference of the measure value. Does this work??
Ah... you are right. I too was wondering where/how the variable ARTIST is set, but of course i don't know. So, I have assumed by definition that evil_dark_lxs specified/set the ARTIST variable somewhere in the skin.
My another idea is...OnChangeAction=["C:\Users\Alexis\Documents\Rainmeter\Skins\Effect\Music\[MeasureArtist].vbs", direct reference of the measure value. Does this work??
-
- Rainmeter Sage
- Posts: 16177
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Condition syntax and Read a File
Yep, this is the problem with incomplete codes, like this. We don't know where and how the ARTIST variable is set. In fact I believe, it doesn't even have to be set, the [MeasureArtist] measure name can be used, instead of setting one more variable. Doesn't worth, at least for now. But there might be something in the complete code, which would require it? Well, we don't know...
Yes, it probably does work, if you're closing the bracket, because it is missing, but is needed: OnChangeAction=["C:\Users\Alexis\Documents\Rainmeter\Skins\Effect\Music\[MeasureArtist].vbs"]. Otherwise it should work.
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Condition syntax and Read a File
My mistake!
-
- Rainmeter Sage
- Posts: 16177
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Condition syntax and Read a File
Yep, but don't worry, it happens many times to all of us.