を使用しようとしましたwindow.setTimeout
が、実行時にエラーが発生します。
182 行目のエラー: TypeError: window.setTimeout は関数ではありません。(の
window.setTimeout(function(){ }, 3000);
、
window.setTimeout
未定義) (-2700)
誰かが私を助けることができますか?
を使用しようとしましたwindow.setTimeout
が、実行時にエラーが発生します。
182 行目のエラー: TypeError: window.setTimeout は関数ではありません。(の
window.setTimeout(function(){ }, 3000);
、
window.setTimeout
未定義) (-2700)
誰かが私を助けることができますか?
JXA には非同期のものはありません。を使用できますdelay(3)
が、他には何も実行されません。
で別のタスクを起動でき$.system("yourCommand &")
ます。非同期で実行されます。これは、非同期で話す小さなデモです。必要なことは何でも行う別のスクリプトである可能性があります
ObjC.import("stdlib")
var app = Application.currentApplication()
app.includeStandardAdditions = true
$.system("(sleep 2;say hurry up!)&") // see the difference when you remove the &
prompt("are you ready?", "yes")
function prompt(text, defaultAnswer) {
var options = { defaultAnswer: defaultAnswer || "" }
try {
return app.displayDialog(text, options).textReturned
} catch (e) {
return null
}
}