Jump to content
Sign in to follow this  
jaberwacky

_IiTunesEvents

Recommended Posts

jaberwacky

The documentation for the iTunes COM Interface supplied with the iTunes SDK says that after you create the iTunes object (objCreate(iTunes.Application") that the other class interfaces will be available through that object. If I have not misunderstood then how would one go about accessing the iTunesEvents class? I tried various things such as:

$iTunesApp = ObjCreate("iTunes.Application")
$iTunesApp.iTunesEvents.onSoundVolumeChangedEvent()

; ===============================

$iTunesEvents = ObjGet($iTUnesApp, "various combinations of the iTunesEvents permutations I could conceive")

and more that I've forgotten. What I'd like to know is if it is possible to access this class and if so how?

Of course any helpful response will be much appreciated. Goodnight.

Share this post


Link to post
Share on other sites
Richard Robertson

You use the ObjEvent function to register handlers for COM object events.

Share this post


Link to post
Share on other sites
jaberwacky

Based on what you told me I got this:

#include <IE.au3>

_IEErrorHandlerRegister()

$iTunesApp = ObjCreate("iTunes.Application")

ObjEvent($iTunesApp, "iTunesEvent")

Sleep(1000)

$iTunesApp.PlayPause

Sleep(3000)

$iTunesApp.SoundVolume = 10

Sleep(3000)

$iTunesApp.SoundVolume = 60

Sleep(3000)

$iTunesApp.PlayPause

Sleep(3000)

$iTunesApp.Quit

$iTunesApp = ''

Func iTunesEvent(Const $event)
    ConsoleWrite("iTunesEvent: " & $event & @LF)
EndFunc

YES! Thanks RichardRobertson!

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.