It is currently April 18th, 2024, 10:49 pm

NowPlaying measure not picking up file path of song in iTunes

Get help with creating, editing & fixing problems with skins
2403dt
Posts: 3
Joined: June 12th, 2018, 10:24 am

NowPlaying measure not picking up file path of song in iTunes

Post by 2403dt »

Hi all,

I have been trying to make a plugin that changes the desktop background based on the song playing through iTunes. The code looks something like this:

Code: Select all

[Rainmeter]
Update=1000
 
[measure]
Measure=NowPlaying
PlayerName=iTunes
PlayerType=Title

IfMatch=Song Name
IfMatchAction=[!SetWallpaper "#@#Background.jpg" Fit][!Update]

[render]
Meter=image
SolidColor=0,0,0,0
X=0
Y=0
Although tedious, this has been working fine for me. As I have multiple songs with the same name, however, I have been wanting to change the PlayerType from Title to Path so that the wrong wallpaper would not come on when a certain song plays:

Code: Select all

[Rainmeter]
Update=1000
 
[measure]
Measure=NowPlaying
PlayerName=iTunes
PlayerType=Path

IfMatch="D:\Music\Song Name.mp3"
IfMatchAction=[!SetWallpaper "#@#Background.jpg" Fit][!Update]

[render]
Meter=image
SolidColor=0,0,0,0
X=0
Y=0
This hasn't been working since the plugin doesn't seem to pick up the path I have put in so I was wondering if I could get help from someone on this forum. Thanks in advance!
Last edited by 2403dt on June 12th, 2018, 1:16 pm, edited 1 time in total.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: NowPlaying measure not picking up file path of song in iTunes

Post by eclectic-tech »

PlayerType=Path is not valid, it should be PlayerType=File to return the path to the playing media file. :)
Documentation: PlayerType
2403dt
Posts: 3
Joined: June 12th, 2018, 10:24 am

Re: NowPlaying measure not picking up file path of song in iTunes

Post by 2403dt »

eclectic-tech wrote:PlayerType=Path is not valid, it should be PlayerType=File to return the path to the playing media file. :)
Documentation: PlayerType
Oh oops haha. Thanks for correcting me and helping.

It still doesn't seem to work.

Code: Select all

[Rainmeter]
Update=1000
 
[measure]
Measure=NowPlaying
PlayerName=iTunes
PlayerType=File

IfMatch="D:\Music\Space Oddity.mp3"
IfMatchAction=[!SetWallpaper "#@#Bowie.png" Fit][!Update]

[render]
Meter=image
SolidColor=0,0,0,0
X=0
Y=0
Is there something wrong with how I wrote the file path?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: NowPlaying measure not picking up file path of song in iTunes

Post by eclectic-tech »

I would suggest: IfMatch="(?i)D:\\Music\\Space Oddity.mp3"
The backslash is a reserved character in PCRE, so you need to escape it.
(?i) will make the match case insensitive, so capitalization is ignored.
2403dt
Posts: 3
Joined: June 12th, 2018, 10:24 am

Re: NowPlaying measure not picking up file path of song in iTunes

Post by 2403dt »

eclectic-tech wrote:I would suggest: IfMatch="(?i)D:\\Music\\Space Oddity.mp3"
The backslash is a reserved character in PCRE, so you need to escape it.
(?i) will make the match case insensitive, so capitalization is ignored.
So that was it. This has been bugging me for the longest time. Thank you so much! :D
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: NowPlaying measure not picking up file path of song in iTunes

Post by eclectic-tech »

Happy to help! :thumbup: