Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript basics - iTunes

    I am a total noob to JS and need a little help.

    Currently writing some small snippets to control iTunes.

    An example:
    Code:
    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:

    Code:
    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?

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,473
    Thanks
    13
    Thanked 361 Times in 357 Posts
    Quote Originally Posted by mcmusic View Post
    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
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •