I've been noodling around with the COM interface to iTunes, and - after some help from Troy and one of our engineers, I got things working - in both VW and OST. I got OST working first, but I have VW open now, so let's start with that. First, I used the type analyzer to get the GUID:
"View Dispatch interface methods and properties"
COMAutomationTypeAnalyzer describeID: 'iTunes.Application' asGUID.
Then, I grabbed the dispatch interface:
"Open an instance and try some methods."
driver := COMDispatchDriver createObject: 'iTunes.Application'.
Then, using the dispatch interface I grabbed the LibraryPlaylist interface and added a file:
"Get the Library playlist interface and add a file to iTunes"
playListLib := driver getProperty: 'LibraryPlaylist'.
playListLib invokeMethod: 'AddFile' with: 'h:\audio\industry_misinterpretations_10-14-06.mp3'.
Which led to this:
Next post- we'll have a look at the OST code.
Technorati Tags:
objectstudio, visualworks, COM