Jump to content

*$&! iTunes object! (Probably something stupid)


Recommended Posts

Ok... I'm currently writing a program that interacts with iTunes or any other media player. I coded the iTunes part seperatly, so if iTunes is open it does the iTunes code, otherwise it does the generic code... However, when iTunes is closed, I get a fatal error:

If $iTunes.PlayerState <> $state Then

And it says $iTunes isn't an object... I can understand that, iTunes is closed, so it's no longer an object, however, the part of code that's in looks like this:

If IsObj($iTunes) Then
        If $iTunes.PlayerState <> $state Then
            If $iTunes.PlayerState = 1 Then
                GUICtrlSetImage($PlayPause, "bitmaps/pause.bmp")
                $state = $iTunes.PlayerState
            Else
                GUICtrlSetImage($PlayPause, "bitmaps/play.bmp")
                $state = $iTunes.PlayerState
            EndIf
        EndIf
    EndIf

So it shouldn't even go into that loop if iTunes is closed... I get that error everytime.... any ideas?

Edited by magician13134
Link to comment
Share on other sites

  • Moderators

You may want to take a look at my Absolute Lyrics Finder Script (see my signature), it integrates very well with both iTunes and Winamp. I thoroughly commented the source so it should be fairly easy to understand. Pay extra close attention to the event functions toward the bottom of the script as I believe this is were your problem is coming from.

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...