Hello!
I am new to javascript and trying to store the result of a javascript script in a variable in my macro.
I have tried several ways, but never make it.
The idea would be something like this macro:
JavaScript:
await WaitForLoading();
await Delay(2000);
var weekday = await EvaluateScript ('var d=new Date(); var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); document.write("Today is " + weekday[d.getDay()])');
Alert (weekday);
await Delay(50000)
Exit();
The obvious intent is to have something like "Today is Tuesday" stored in "weekday" if the macro is executed on a tuesday.
Is there a way to get that done?
Thanks for your help in advance!!
I am new to javascript and trying to store the result of a javascript script in a variable in my macro.
I have tried several ways, but never make it.
The idea would be something like this macro:
JavaScript:
await WaitForLoading();
await Delay(2000);
var weekday = await EvaluateScript ('var d=new Date(); var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); document.write("Today is " + weekday[d.getDay()])');
Alert (weekday);
await Delay(50000)
Exit();
The obvious intent is to have something like "Today is Tuesday" stored in "weekday" if the macro is executed on a tuesday.
Is there a way to get that done?
Thanks for your help in advance!!