locked
Creating A Timed Delay RRS feed

  • Question

  • Hey, i'm new to this, but i want to create a delay before it executes an existing function.  I am simply writing code in notepad and saving it as a .js file.  It opens itunes and start playing the qeued song:

    play();
    function play()
    {
    var iTunes = WScript.CreateObject("iTunes.Application");
    iTunes.play();
    }

    I would like to add a 15 second delay to this from the moment the .js file is executed, any suggestions?? couldn't figure out how to get the timer() to work.
    Saturday, April 11, 2009 10:08 PM

All replies

  • window.setTimeout('play()',15000);
    function play()
    {
    var iTunes = WScript.CreateObject("iTunes.Application");
    iTunes.play();
    }
    Thursday, May 14, 2009 10:18 AM