Switch to the dark side!

Rainmeter

Latest Discussion
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
More...

Post a new topic



iTunes Song Information

4272
Kaelri says:

I searched this forum. I found a two-year-old thread full of complaints about the lack of an iTunes plugin for Rainmeter.

It's been two years. There MUST be a way. Can anyone help me find it?

10:41 pm, Tuesday, September 02, 2008 (8 years ago)
Avatar-50x50
dragonmage says:

Haven't tested yet, but you may want to take a look at

02:59 am (8 years ago)
Avatar-50x50
Luke_free says:

I found a really handy vbs script for song information, I've changed it a little myself, (don't know how to upload here)

it gets song name, artist, and track time and prints to a .txt file, then you can use rainmeter to read the file and print information (checking every 1-5 seconds)

I found the script here:


and there is more information about song info here:


I think it is causing crashed of rainmeter at the moment, i;m not sure.

I'm trying to figure out how to get a progress bar, using a timer and the track time, then using the bar meter.

I know this isn't control of itunes, but it's a start.

--script--

' ==== USER-DEFINABLE PARAMETERS =======================================

FILENAME = "C:\Users\Luke\Links\rainmeter_itunes_playing.txt"
SECONDS_BETWEEN_CHECKS = 1

' ======================================= USER-DEFINABLE PARAMETERS ====



Function UpdateInfo()
Set Current = iTunes.CurrentTrack

Name = Current.Name
Artist = Current.Artist
Length = Current.Time

Set f1 = fso.CreateTextFile(FILENAME)
f1.Write Name + vbCrLf + Artist + vbCrLf + Length
f1.Close
End Function

Function ClearInfo()
Set f1 = fso.CreateTextFile(FILENAME)
f1.Write vbCrLf
f1.Close
End Function



Set fso = CreateObject("Scripting.FileSystemObject")

iTunesRunning = 0

delay = SECONDS_BETWEEN_CHECKS * 1000

Do
Do
ClearInfo()

Wscript.Sleep(delay)

Set colProcesses = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQ
uery( "Select * From Win32_Process", , 48 )
For Each objProcess in colProcesses
If LCase(objProcess.Name) = "itunes.exe" Then iTunesRunning = 1
Next
Loop While iTunesRunning = 0

Set iTunes = CreateObject("iTunes.Application")

Do
PlayState = iTunes.PlayerState

If PlayState Then
UpdateInfo()
Else
ClearInfo()
End If

Wscript.Sleep(delay)

iTunesRunning = 0

Set colProcesses = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQ
uery( "Select * From Win32_Process", , 48 )
For Each objProcess in colProcesses
If LCase(objProcess.Name) = "itunes.exe" Then iTunesRunning = 1
Next
Loop While iTunesRunning = 1

Set iTunes = Nothing
Loop

--end script--

(cut down the comments at the top)

11:16 pm (8 years ago)
 

Reply to this topic

You must register and become a member to post a reply.