I am attempting to take a list of variables that I have generated using apple automator and input those variables into my Javascript, but I haven't been having much luck. My current code looks like this:
function run(input, parameters) {
var safari = Application("Safari");
safari.includeStandardAdditions = true;
var jsScript ="jsScript += document.getElementById('search-name').value = '"
+ input[0] + input[1]
+ "';";
"jsScript += document.getElementById('search-location').value = '"
+ input[2] + input[4]
+ "';";
jsScript += "document.getElementById('wp-search').click();";
safari.doJavaScript(jsScript, { in:safari.windows[0].currentTab});
return jsScript;
}
I am getting the error can't find variable: jsScript. Please any help would be greatly appreciated.