[object Application].scheduleTask
app.scheduleTask(string, number, bool);
自動実行するスクリプトを定義できる。
また、それを定期的に実行したりもできる。
返り値はタスク番号
string = 実行したいスクリプト
number = 実行の間隔 単位ミリ秒
bool = 繰り返し実行するか
例
//10秒おきにalertがでる
app.scheduleTask("alert('hoge')", 10000, true);
例2
//10秒おきにalertがでる
var str = "alert('hoge')";
var time = 10000;
app.scheduleTask(str, time, true);
例3
//10秒おきにalertがでる
function hoge(){
alert("hoge");
}
var str = "hoge()";
var time = 10000;
app.scheduleTask(str, time, true);
例文は無限に実行するので注意。
cancelTaskの為にも、scheduleTaskは何かしらの変数に入れておいたほうがよい。
var task1 = app.scheduleTask("alert('hoge')", 10000, true);
など。