问题
so when i run this macro in imacros it directs me to www.undefined.com any ideas how i can fix this?
also: it directs me to the first url but when it loops the second time it gets to that site
var macro;
macro ="CODE:";
macro +="VERSION BUILD=8601111 RECORDER=FX"+"\n";
macro +="TAB T=1"+"\n";
macro +="TAB CLOSEALLOTHERS"+"\n";
macro +="URL GOTO={{random}}"+"\n";
var am = "www.google.com"
var amc = "www.youtube.com"
var amb = "www.yahoo.com"
var link=[am, amc, amb];
#this is for selecting a random value
var random = Math.floor((Math.random() * 2));
iimSet("link",link[random])
iimPlay(macro)
#this is for looping 10 times
var n=10;
for(var i=0;i<n;i++)
{
iimPlay(macro)
}
回答1:
Once again. Just apply this:
var random = Math.floor(Math.random()*link.length);
And according to your iim-code, set 'random' instead of 'link' :
iimSet("random",link[random]);
来源:https://stackoverflow.com/questions/32904881/imacros-javascript-i-get-www-undefined-com-error