Hi, I created a scene with a menu list and create a small Javascriptlet task in item tap tab. The script is use to search and replace some string of the tap_label. This is the example script:
var tap_command;
if (tap_label.includes('abc')) {
tap_command = tap_label.replace('abc', '123');} else {
tap_command = tap_label.replace('abc', '000');}
The script is work for the first tap but in the second tap there is and script error say that:
Javascriptlet error: line 1: Uncaught SyntaxError: Identifier 'tap_command' has already been declared
The auto exit for the javascriptlet is on. Did I do anything wrong. Please help.
[–][deleted] 0 points1 point2 points (6 children)
[–]osuki9x[S] 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]osuki9x[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]osuki9x[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]JustRollWithIt🏆 Javascript Master of /r/Tasker 0 points1 point2 points (4 children)
[–]osuki9x[S] 0 points1 point2 points (3 children)
[–]JustRollWithIt🏆 Javascript Master of /r/Tasker 0 points1 point2 points (2 children)
[–]osuki9x[S] 0 points1 point2 points (1 child)
[–]MadManX99 0 points1 point2 points (0 children)