Imacros Javascript Macro Random Variable Question
up vote
-1
down vote
favorite
I created a script to run on imacros to update the resolution of responsive design mode on firefox but after the script choice random value do not extract the correct value of array.
Can you help me to solve, i need to add the result of random array.
This is the code
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
iimSet("height",myheight[randomint]);
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
iimSet("width",mywidth[randomint]);
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", "height");
prefs.setCharPref("devtools.responsiveUI.customWidth", "width");
This script must update the values extracted but do not extract correctly the values.
javascript firefox var imacros
add a comment |
up vote
-1
down vote
favorite
I created a script to run on imacros to update the resolution of responsive design mode on firefox but after the script choice random value do not extract the correct value of array.
Can you help me to solve, i need to add the result of random array.
This is the code
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
iimSet("height",myheight[randomint]);
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
iimSet("width",mywidth[randomint]);
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", "height");
prefs.setCharPref("devtools.responsiveUI.customWidth", "width");
This script must update the values extracted but do not extract correctly the values.
javascript firefox var imacros
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I created a script to run on imacros to update the resolution of responsive design mode on firefox but after the script choice random value do not extract the correct value of array.
Can you help me to solve, i need to add the result of random array.
This is the code
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
iimSet("height",myheight[randomint]);
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
iimSet("width",mywidth[randomint]);
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", "height");
prefs.setCharPref("devtools.responsiveUI.customWidth", "width");
This script must update the values extracted but do not extract correctly the values.
javascript firefox var imacros
I created a script to run on imacros to update the resolution of responsive design mode on firefox but after the script choice random value do not extract the correct value of array.
Can you help me to solve, i need to add the result of random array.
This is the code
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
iimSet("height",myheight[randomint]);
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
iimSet("width",mywidth[randomint]);
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", "height");
prefs.setCharPref("devtools.responsiveUI.customWidth", "width");
This script must update the values extracted but do not extract correctly the values.
javascript firefox var imacros
javascript firefox var imacros
asked Nov 10 at 22:47
placidomaio
326
326
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I hope the following script should work:
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
height = myheight[randomint];
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
width = mywidth[randomint];
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", height);
prefs.setCharPref("devtools.responsiveUI.customWidth", width);
The iimSet()
function is useless without the iimPlayCode()
(or iimPlay()
) functions called later in the code.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I hope the following script should work:
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
height = myheight[randomint];
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
width = mywidth[randomint];
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", height);
prefs.setCharPref("devtools.responsiveUI.customWidth", width);
The iimSet()
function is useless without the iimPlayCode()
(or iimPlay()
) functions called later in the code.
add a comment |
up vote
0
down vote
I hope the following script should work:
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
height = myheight[randomint];
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
width = mywidth[randomint];
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", height);
prefs.setCharPref("devtools.responsiveUI.customWidth", width);
The iimSet()
function is useless without the iimPlayCode()
(or iimPlay()
) functions called later in the code.
add a comment |
up vote
0
down vote
up vote
0
down vote
I hope the following script should work:
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
height = myheight[randomint];
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
width = mywidth[randomint];
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", height);
prefs.setCharPref("devtools.responsiveUI.customWidth", width);
The iimSet()
function is useless without the iimPlayCode()
(or iimPlay()
) functions called later in the code.
I hope the following script should work:
myheight = new Array();
myheight.push("1000");
myheight.push("1100");
myheight.push("1200");
randomint = Math.floor(Math.random()*myheight.length);
height = myheight[randomint];
mywidth = new Array();
mywidth.push("800");
mywidth.push("900");
mywidth.push("1000");
randomint = Math.floor(Math.random()*mywidth.length);
width = mywidth[randomint];
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("devtools.responsiveUI.customHeight", height);
prefs.setCharPref("devtools.responsiveUI.customWidth", width);
The iimSet()
function is useless without the iimPlayCode()
(or iimPlay()
) functions called later in the code.
answered Nov 11 at 19:53
Shugar
4,849159
4,849159
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244175%2fimacros-javascript-macro-random-variable-question%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown