It is currently May 6th, 2024, 10:38 am
Get help with creating, editing & fixing problems with skins
jsmorley
Developer
Posts: 22631 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » February 8th, 2012, 10:37 pm
Don't mean to hijack or sidetrack this thread, but since this whole discussion started back in the day, we have added Lua scripting to Rainmeter, and this might be another alternative:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[TITLEcounted]
measure=plugin
Plugin=NowPlaying.dll
PlayerName=iTunes
PlayerType=title
[MeasureLuaScript]
Measure=Script
ScriptFile=Test.lua
[countTITLEstring]
meter=string
FontColor=255,255,255,255
SolidColor=0,0,0,1
text=There are [MeasureLuaScript] characters in [TITLEcounted].
DynamicVariables=1
Test.Lua:
Code: Select all
PROPERTIES =
{
}
function Initialize()
msMeasure = SKIN:GetMeasure('TITLEcounted')
end
function Update()
sTitle = msMeasure:GetStringValue()
return sTitle:len()
end
Brian
Developer
Posts: 2689 Joined: November 24th, 2011, 1:42 am
Location: Utah
Post
by Brian » February 8th, 2012, 10:56 pm
The more the merrier. I like how there is more than 1 solution to problems, just shows how robust Rainmeter really is.
-Brian
Brian
Developer
Posts: 2689 Joined: November 24th, 2011, 1:42 am
Location: Utah
Post
by Brian » February 9th, 2012, 5:47 am
Just in case you still wanted to use the "Title" of the track AND still use the count, then you could make a secondary measure like this:
Code: Select all
[TITLE]
measure=plugin
Plugin=NowPlaying.dll
PlayerName=iTunes
PlayerType=title
[TITLEcounted]
measure=plugin
Plugin=NowPlaying.dll
PlayerName=[TITLE]
PlayerType=title
RegExpSubstitute=1
Substitute="[\s\d\D]":"1+"
This way [TITLE] would not be changed by the substitute. JSMorley's lua script avoids this as well.
-Brian