...

View Full Version : javascript basics - iTunes



mcmusic
09-19-2011, 03:22 PM
I am a total noob to JS and need a little help.

Currently writing some small snippets to control iTunes.

An example:


var iTunesApp = WScript.CreateObject("iTunes.Application");
iTunesApp.LibraryPlaylist.AddFile('B:\\filetoadd.mp4');

Nicely adds a file to the library.

Now, i need to set the encoder. I try this:



var iTunesApp = WScript.CreateObject("iTunes.Application");
iTunesApp.CurrentEncoder("MP3");

I get: object doesn't support this property of method.

iTunes SDK docs:


HRESULT IiTunes::CurrentEncoder ( [in] IITEncoder * iEncoder )

Sets the current encoder (AAC, MP3, AIFF, WAV, etc.).


Parameters:
iEncoder An IITEncoder object corresponding to the new encoder.


Any ideas?

Dormilich
09-20-2011, 08:35 AM
iTunes SDK docs:

HRESULT IiTunes::CurrentEncoder ( [in] IITEncoder * iEncoder )

Sets the current encoder (AAC, MP3, AIFF, WAV, etc.).


Parameters:
iEncoder An IITEncoder object corresponding to the new encoder.


Any ideas?

there are 2 problems:
- the first object has to be a IiTunes object (not sure if you create the correct one)
- the method CurrentEncoder() expects an IITEncoder object to be given, not a string



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum