Javascript's setTimeout
function is a method of the window
object. This object doesn't exist in ExtendScript and is therefore not available to scripts made for Adobe InDesign or Illustrator. What can I use instead to acheive the same results?
It's part of the extendscript's $
object.
$.sleep(1000) //tell extendscript to sleep 1000 milliseconds
Not the same as setTimeout() but you should be able to make it work for you.
EDIT: Here is setTimeout extension for extendscript:
$.setTimeout = function(func, time) {
$.sleep(time);
func();
};
$.setTimeout(function () {alert("hello world")}, 3000);