mladost1 Posted June 26, 2008 Posted June 26, 2008 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: $obj=ObjCreate("iTunes.Application") $event=ObjEvent($a,"MyITevents_","ITEventTest_") Func MyITevents_OnQuittingEvent() MsgBox(0,"iTunes closing","Script is also doing that") Exit EndFunc Any help is welcome
Moderators big_daddy Posted June 26, 2008 Moderators Posted June 26, 2008 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.
Moderators big_daddy Posted June 27, 2008 Moderators Posted June 27, 2008 Doesn't work I tried it If at first you don't succeed, try, try again. $oiTunes = ObjCreate("iTunes.Application") $oiTunesEvent = ObjEvent($oiTunes, "_Event_") While True Sleep(50) WEnd Func _Event_OnAboutToPromptUserToQuitEvent () ConsoleWrite("iTunes is about to quit!" & @CR) Exit EndFunc
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now