07-24-2023, 10:22 AM
I'm running a jscript on Microsoft Orchestrator 2012, and I keep getting this error
Activities\RunScript\w0vjlke0.0.js(8,14) : error JS1015: Unterminated string constant
It would be greatly appreciated if you could help me as I can't seem to find out what's causing it.
I guess this would be a rubber ducky debug ^_^
//Questions and answers will be ordered in two separated arrays
var questions = new Array();
var answers = new Array();
//Your data
var myData = '\`d.T.~Ed/{8DFD771C-13FA-40D4-84AE-8ECD056BCC2D}.UserInput\`d.T.~Ed/';
//Regex goes here
var regex=/\"(.*?)\"/g;
var match = regex.exec(myData);
var i = 1;
var pos = 0;
//Loop for all questions and answers, avoiding the type="string" attribute
while (match != null) {
pos = i % 3;
switch(pos){
case 1: questions[questions.length] = match[1]; break;
case 2: answers[answers.length] = match[1]; break;
}
i++;
match = regex.exec(myData);
}
//Check all questions and answers are at their correct positions
//Loop to grab all data and input the html fields to format into table
var counter='';
var objectnumber=(i-5);
objectnumber = objectnumber/2;
counter=0;
var html1q='<tr><td>';
var html2q='</td><td>';
var html3q='</td></tr>';
var realtext='';
while (objectnumber != counter) {
realtext += html1q + questions[counter] + html2q + answers[counter] + html3q;
counter++;
}
output=realtext;
Okay thanks guys!
Activities\RunScript\w0vjlke0.0.js(8,14) : error JS1015: Unterminated string constant
It would be greatly appreciated if you could help me as I can't seem to find out what's causing it.
I guess this would be a rubber ducky debug ^_^
//Questions and answers will be ordered in two separated arrays
var questions = new Array();
var answers = new Array();
//Your data
var myData = '\`d.T.~Ed/{8DFD771C-13FA-40D4-84AE-8ECD056BCC2D}.UserInput\`d.T.~Ed/';
//Regex goes here
var regex=/\"(.*?)\"/g;
var match = regex.exec(myData);
var i = 1;
var pos = 0;
//Loop for all questions and answers, avoiding the type="string" attribute
while (match != null) {
pos = i % 3;
switch(pos){
case 1: questions[questions.length] = match[1]; break;
case 2: answers[answers.length] = match[1]; break;
}
i++;
match = regex.exec(myData);
}
//Check all questions and answers are at their correct positions
//Loop to grab all data and input the html fields to format into table
var counter='';
var objectnumber=(i-5);
objectnumber = objectnumber/2;
counter=0;
var html1q='<tr><td>';
var html2q='</td><td>';
var html3q='</td></tr>';
var realtext='';
while (objectnumber != counter) {
realtext += html1q + questions[counter] + html2q + answers[counter] + html3q;
counter++;
}
output=realtext;
Okay thanks guys!