It is currently April 19th, 2024, 1:21 pm

Opening Spotify not working

Get help with creating, editing & fixing problems with skins
DoobyDoobs
Posts: 7
Joined: October 31st, 2022, 11:24 am

Opening Spotify not working

Post by DoobyDoobs »

Hello,

I have been playing around with this code for the last few hours and I cant seem to get the 'openplayer' function to work, when I have spotify open I can open the program, as in from minimization to the front page, but if spotify is not there then I am not able to open it. I have tried with alot of values for the calculation and can confirm from sites that 0 should be the correct value for spotify not being open, but I digress; code here, with measureplayer being spotify although tbh idk if that is even the case;

Code: Select all

[MeasurePlayer]
Measure=NowPlaying
PlayerName=Spotify
PlayerType=STATUS

[MeasureState]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=STATE

[MeasurePlay]
Measure=Calc
Formula=(( Measureplayer > 0 ) ? -1 : 0 )
IfCondition=(Measureplay <> 0)
IfFalseAction=[!SetOption MeterPlay LeftMouseUpAction """[!CommandMeasure "Measureplayer" "OpenPlayer"][!Delay "2000"][!CommandMeasure "MeasurePlayer" "Play"]"""][!UpdateMeter "MeterPlay"]
IfTrueAction=[!SetOption MeterPlay LeftMouseUpAction """[!CommandMeasure "MeasurePlayer" "PlayPause"]"""][!UpdateMeter "MeterPlay"]
Any help would be great, and the issue if it wasn't clear seems to be that measureplayer seems to have an unknown value to the computer so that it will never be calculated in the formula or something.

Thanks
Last edited by DoobyDoobs on November 1st, 2022, 8:52 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Opening Spotify not working

Post by balala »

DoobyDoobs wrote: November 1st, 2022, 11:50 am I have been playing around with this code for the last few hours and I cant seem to get the 'openplayer' function to work, when I have spotify open I can open the program, as in from minimization to the front page, but if spotify is not there then I am not able to open it.
Spotify unfortunately is just partially supported and as such, you can't use the OpenPlayer bang. The playPause bang is supported and this is why it is working, but OpenPlayer is not, so it doesn't work. To make sure this is the case, suggest you trying the code with a completely supported player. If you don't have another, try Windows Media Player. For this you only have to replace the PlayerName=Spotify option of the [MeasurePlayer] measure with PlayerName=WMP. You get the code working well. So, you can't do what you want with Spotify, at least not with NowPlaying measures.
DoobyDoobs
Posts: 7
Joined: October 31st, 2022, 11:24 am

Re: Opening Spotify not working

Post by DoobyDoobs »

Damn, well thanks for the clarification, do dyou know if command prompt can open spotify? because I'm willing to have a command prompt pop up so it can open spotify because that would be cool I think.

Thanks
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Opening Spotify not working

Post by balala »

DoobyDoobs wrote: November 1st, 2022, 8:52 pm do dyou know if command prompt can open spotify?
I'm not using Spotify so am not entirely sure, but I believe you can use a command prompt to open it (in fact as far as I can tell, you can use the command prompt to open any of the installed apps). And this can be done even through a RunCommand plugin measure, in which case you can keep the command prompt window hidden.
But before proceeding to this, you have to know that as far as I know, there is a plugin which works well with Spotify. Unfortunately, since as said I'm not using Spotify, I can't name the plugin, just know there is one. Here someone using it will be needed to help.
If in meantime, you are not interested in using the plugin and still want to use the command prompt solution, please let me know.