Jump to content
Sign in to follow this  
magician13134

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

Recommended Posts

magician13134

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

Share this post


Link to post
Share on other sites
big_daddy

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.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.