Page 1 of 1

problems with app.scheduleTask

Posted: October 29th, 2006, 2:48 pm
by lloydalvarez
I am writing a script where i want to delay the calling of a function, but i seem to be having some odd behavior from app.scheduleTask

I can call the function, but it doesn't pass the variables to it.

So

Code: Select all

app.scheduleTask("myFunction();",1000,0)    // this works

myFunction(value1,value2);  // this also works

app.scheduleTask("myFunction(value1,value2);",1000,0)  // this doesn't work
is there something special about scheduleTask that i am missing?

-Lloyd

Posted: October 30th, 2006, 9:21 pm
by nab
Hello Lloyd,

my "scheduleTask/cancelTask" test seems to work, look at this script and you will hopefully find why that does not work for you.
http://www.nabscripts.com/Forum/Scripts ... xample.jsx

(to be totally honest I've never used this method until this evening)

Posted: October 30th, 2006, 10:36 pm
by lloydalvarez
var myScript = "myFunction(val);";
I hadn't thought of putting the string in a variable.. thanks for the tip i am defintely going to try it..

-Lloyd