Having shown how to hit iTunes from VW, here's how I did the same thing in ObjectStudio. OST is more Windows oriented, so things were a bit simpler:
"Get a COM interface and a dispatch object"
ole := OLEObject newProgId: 'iTunes.Application'.
dispatcher := ole dispatcher.
"get the Playlist interface"
libPlay := dispatcher at: 'LibraryPlaylist'.
"Now add the file"
result := libPlay call: 'AddFile' params: (Array with: 'h:\audio\industry_misinterpretations_10-14-06.mp3').
Refer back to the same image from the previous post; it all worked the same way :) COM from Smalltalk isn't quite as hard as I thought it was.
Technorati Tags:
objectstudio, visualworks, COM