firefox - JavaScript+iMacros if-else -


I have some problems with iMacros in Firefox.

This is my macro "test.js":

  Miscellaneous macro; Var macrocon; Var s_n = "\ n"; Var getExtract; Var i; (I = 1; i & lt; = 3; i ++) for {macros = "code:"; Macros + = "SET! ERRINIGNORE YES" + s_n; Macros + = "SET! EXTRACT_TEST_POPUP not" + s_n; Macros + = "SET! Datasource testing \ .csv" + s_n; Macros + = "SET! DATASOURCE_LINE" + i + s_n; Macros + = "SET! VAR1 {{! COL8}}" + S_N; Macros + = "add! Extract {{! VAR1}}" + s_n; GetExtract = iimGetExtract (1); IimDisplay (getExtract); If (getExtract == 1) {macros + = "url goto = {{!! COL5}}" + S_N; } And if (getExtract == 2) {macros + = "url goto = {{! Coal 6}}" + s_en; } And if (getExtract == 3) {macros + = "URL Goto = {{!! 7}}" + S_N; } Macros + = "end seconds = 1" + s_n; Macrosrun = iimplay (macros); }  

and this is "test.csv"

  1, "test", "test", 12345, "http://twitter.com "," Http://facebook.com "," http://google.com ", 1," Test 1 "2," Exam "," Exam ", 12345," http://twitter.com " "Http://facebook.com", "http://google.com", 2, "Test 2" 3, "Exam", "Examination", 12345, "http://twitter.com", "http : //facebook.com "," http://google.com ", 3," Test 3 " 

I think if the first string in column 1 is" ​​1 " Go to "twitter.com" on Macros 'If' 2 "-" facebook.com ", and if" 3 "-" google.com "

but the actual macros will go 3 - 1 - 2 ... no 1 - 2 - 3 ... why?)

Is there anyone in me Can you pity?

If you call iimPlay before calling call getLastExtract, Will pull.

Here is your example with some modifications:

  var macros; Var macrocon; Var s_n = "\ n"; Var getExtract; Var i; Var col5, col6, col7; (I = 1; i & lt; = 3; i ++) for {macros = "code:"; Macros + = "SET! ERRINIGNORE YES" + s_n; Macros + = "SET! EXTRACT_TEST_POPUP not" + s_n; Macros + = "SET! Datasource testing \ .csv" + s_n; Macros + = "SET! DATASOURCE_LINE" + i + s_n; Macros + = "SET! VAR1 {{! COL8}}" + S_N; Macros + = "add! Extract {{! VAR1}}" + s_n; Macros + = "SET! VAR1 {{! COL5}}" + s_n; Macros + = "add! Extract {{! VAR1}}" + s_n; Macros + = "SET! VAR1 {{! COL6}}" + s_n; Macros + = "add! Extract {{! VAR1}}" + s_n; Macros + = "SET! VAR1 {{! COL7}}" + S_N; Macros + = "add! Extract {{! VAR1}}" + s_n; IimPlay iimGetExtract macrosrun = iimPlay (macros) added before calling; // Drag all extracted values ​​and extract string strings = iimGetExtract (). Split (/ \ [extract \] /) split; GetExtract = parseInt (removed [0]); Col5 = Extracted [1]; Col6 = Extracted [2]; Col7 = Extracted [3]; Macros = "CODE:"; If (getExtract === 1) {macros + = "url goto =" + 5 + sdn; } And if (getExtract === 2) {macros + = "url goto =" + 6 + s_n; } And if (getExtract === 3) {macros + = "url goto =" + call 7 + s_n; } Macros + = "end seconds = 1" + s_n; Macrosrun = iimplay (macros); }  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -