dimanche 12 juin 2016

How to change focus on tabs using iMacros JS for Firefox


I have created a script using imacros javascript for firefox:

i want to create a function that can go and focus to the first tab, after opening the three tabs that are already working I have try already some samples but can't figure it out how to do this

var macro;
var MyDelay;
MyDelay = Math.round(Math.random() * (5 - 2) + 2);

macro ="CLEAR"+"n";
macro +="TAB CLOSEALLOTHERS"+"n";
macro +="SET !ERRORIGNORE YES"+"n";
macro +="SET !TIMEOUT 10"+"n";
macro +="SET !TIMEOUT_PAGE 10"+"n";

tabopen ="SET !ERRORIGNORE YES"+"n";
tabopen +="SET !TIMEOUT 10"+"n";
tabopen +="SET !TIMEOUT_PAGE 10"+"n";
tabopen +="TAB OPEN"+"n";

tab1 ="TAB T=1"+"n";
tab1 +="SET !ERRORIGNORE YES"+"n";
tab1 +="SET !TIMEOUT 10"+"n";
tab1 +="SET !TIMEOUT_PAGE 10"+"n";
tab1 +="URL GOTO=http://google.com"+"n";
tab1 += "WAIT SECONDS=" + MyDelay + "n";

tab2 ="TAB T=2"+"n";
tab2 +="SET !ERRORIGNORE YES"+"n";
tab2 +="SET !TIMEOUT 10"+"n";
tab2 +="SET !TIMEOUT_PAGE 10"+"n";
tab2 +="URL GOTO=http://google.com"+"n";
tab2 +="WAIT SECONDS=" + MyDelay + "n";

tab3 ="TAB T=-2"+"n";
tab3 +="SET !ERRORIGNORE YES"+"n";
tab3 +="SET !TIMEOUT 10"+"n";
tab3 +="SET !TIMEOUT_PAGE 10"+"n";
tab3 +="URL GOTO=http://google.com"+"n";
tab3 +="WAIT SECONDS=" + MyDelay + "n";

for (var i=1;i<50000;i++) {
    iimDisplay("Total: loop "+i+" here ");
    iimSet("i", i);
    iimPlayCode(macro);
    iimPlayCode(tab1);
    iimPlayCode(tabopen);
    iimPlayCode(tab2);
    iimPlayCode(tabopen);
    iimPlayCode(tab3);
}

and i renamed this script (woobi.js)

also have try TAB T=1 but its not working


Aucun commentaire:

Enregistrer un commentaire