Jump to content
Sign in to follow this  

iTunes OBJ event handling

Recommended Posts


Hey i'm doing a simple script which maps a few basic iTunes functions to hotkeys on my notebook. However, every time I close iTunes this pop-up appears saying that a script is attached to it. I know it throws an event when i click the close (X) button and if i am able to catch this event I will close the script before that and the pop-up won't show.

Anyway, there's the script:


Func MyITevents_OnQuittingEvent()
    MsgBox(0,"iTunes closing","Script is also doing that")

Any help is welcome :)

Share this post

Link to post
Share on other sites

Something like this should work.

$oiTunes = ObjCreate("iTunes.Application")
$oiTunesEvent = ObjEvent($oiTunes, "_Event_")

Func _Event_OnQuittingEvent()
    ; Do something
EndFunc   ;==>_Event_OnQuittingEvent

It may be worth taking a look at my Absolute Lyrics Finder script, it has a great deal of iTunes automation.

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.