The QuickTime COM interface is poorly documented, but Rousseau mentioned the cool trick of using MicroSoft's OLEView tool to explore. I had never used it before, so here is a quick walk-through.
- Download oleview.exe if you don't already have it (see References section).
- Open a command shell and run oleview.exe. It opens a window titled "OLE/COM Object Viewer".
- Open the "Type Libraries" tab (it's near the bottom). You'll be interested in everything that starts with "Apple QuickTime" as well as "QtMovExporter".
- For example, double-click on "Apple QuickTime Player Library 1.0" to open the IDL viewer. Look in the IDL panel and find the declaration "library QuickTimePlayerLib". Now realize that this library is what a script refers to in a line such as "WScript.CreateObject("QuickTimePlayerLib.QuickTimePlayerApp")".
- Expand the "dispinterface" tabs for IQuickTimePlayerApp, IQuickTimePlayers, and IQuickTimePlayer. Compare the listed methods with the ones used in our script.
- Notice that the IQuickTimePlayer.QTControl method returns an "IQTControl" object. It's not defined in QuickTimePlayerLib. Close the IDL viewer window and return to the main OLE view window. Double-click "Apple QuickTime Control 2.0" to view its interface and observe that it defines IQTControl.
References
I have lots more QuickTime references that will appear in an upcoming post about the automation itself.
- Automating QuickTime at the Command Line on Windows… XSIBlog article by Luc-Eric Rousseau, 2006. This excellent post got me started in this direction.
- Microsoft Windows OLEView. The link is for the Windows 2000 Resource Kit version. You can also get it as part of the Windows Server 2003 Resource Kit.
- "Exploiting Perl on Windows with OLE/COM" (PowerPoint) presentation by Roth Consulting provides an excellent overview of Component Object Model (COM) and how it relates to WSH scripting.

1 comments:
I have just converted the script to Python and will be posting it soon.
Post a Comment