Jump to content

Itunes Current Song


death pax
 Share

Recommended Posts

just want to thank for your first script to get the trackname and artist

It does other stuff: .album, .time., .genre... Probably anything under the iTunes menu...

@death Pax: Thanks, I'm trying to learn about objects and this is helpful... I was thinking of making a mini player for iTunes but decided it would be completely useless! :shocked:

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • 1 year later...

Itunes Current Song - Displayed in Skype MoodText

CODE
;Thanks to Greenmachine's original work

;I Added Skype Moodtext option

;Updated March 13, 2009

Global $oItunes

$oSkype = ObjCreate("Skype4COM.Skype"); Added - Creates the skype object

$CurrentSong = GetCurrentItunesSong()

TrayTip ("Current Song", $CurrentSong, 1)

$oSkype.CurrentUserProfile.MoodText = "Listening to: " & $CurrentSong; Added - Populate the MoodText with current song playing

Do

Sleep (1000)

$NewSong = GetCurrentItunesSongAfterCreation()

If $NewSong <> $CurrentSong Then

$CurrentSong = $NewSong

TrayTip ("Song Changed", $CurrentSong, 1)

$oSkype.CurrentUserProfile.MoodText = "Listening to: " & $CurrentSong; Added - Populates the Moodtext with the new song playing

EndIf

Until Not ProcessExists ("iTunes.exe")

Func GetCurrentItunesSongAfterCreation()

Local $Title = ""

$state=$oItunes.PlayerState

If $State=1 Then

$curtrack=$oItunes.CurrentTrack

$Trackname=$curtrack.Name

$Artistname=$curtrack.Artist

$Title=$ArtistName & " - " & $TrackName

EndIf

Return $Title

EndFunc

Func GetCurrentItunesSong()

Local $Title = ""

$oItunes = ObjCreate("iTunes.Application")

If @error Then

Msgbox (0,"iTunes","Error Getting an active iTunes Object. Error code: " & Hex (@error, 8))

Exit

EndIf

$State=$oItunes.PlayerState

If $State=1 Then

$curtrack=$oItunes.CurrentTrack

$Trackname=$curtrack.Name

$Artistname=$curtrack.Artist

$Title=$ArtistName & " - " & $TrackName

EndIf

Return $Title

EndFunc

Edited by VOIPER
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...