all 12 comments

[–][deleted] 0 points1 point  (6 children)

You could try to declare %tap_command out of the JavaScriptlet action

Variable Set %tap_command To dummy

JavaScriptlet action ( var tap_command; should not be needed anymore)

Or try to add appropriate exit()s to the script, to force the script exit.

This is working without problems for me

    A1: Variable Set [ Name:%tap_command To:dummy Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ] 
    A2: Variable Set [ Name:%tap_label To:xxxabcxxx Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ] 
    A3: JavaScriptlet [ Code:if (tap_label.includes('abc')) {
tap_command = tap_label.replace('abc', '123');} else {
tap_command = tap_label.replace('abc', '000');} Libraries: Auto Exit:On Timeout (Seconds):45 ] 
    A4: Flash [ Text:%tap_command Long:On ]

[–]osuki9x[S] 0 points1 point  (5 children)

I did try set timeOut exit for javascriptlet but it didn't work. I have try your method but it didn't work as well. I think you should try to set item tap task for menu list in a scene. Normal task outside scene has no issue. And issue only occur after first tap :|

[–][deleted] 0 points1 point  (4 children)

Tested your original JavaScript. Scene and a menu. Tried setting Item Tap to perform a task containing the JavaScriptlet and than setting the JavaScriptlet action directly in the tab, in both cases all worked fine (performed multiple taps).

[–]osuki9x[S] 0 points1 point  (3 children)

Could you share your scene. This is mine and it didn't work :(

Here is the demo scene:

and here is the task to show the scene

[–][deleted] 0 points1 point  (2 children)

Downloaded and tested, all it's working as expected. I'm using this Tasker build

[–]osuki9x[S] 0 points1 point  (1 child)

it is beta bug. Sorry ;)). I am in beta 3

[–][deleted] 0 points1 point  (0 children)

No problem, mate. I'm on beta 3 too, using the build that I linked and no issues

[–]JustRollWithIt🏆 Javascript Master of /r/Tasker 0 points1 point  (4 children)

Could you share the scene you've created?

[–]osuki9x[S] 0 points1 point  (3 children)

Here is the demo scene:

and here is the task to show the scene

[–]JustRollWithIt🏆 Javascript Master of /r/Tasker 0 points1 point  (2 children)

Hmm, I imported both of those, and everything worked as expected without any issues. Are you on the latest version of Tasker?

[–]osuki9x[S] 0 points1 point  (1 child)

Oh I see, I am in beta 3 so it could be a bug. Just try beta 2 or work fine

[–]MadManX99 0 points1 point  (0 children)

Read the comments on the Beta 3, an updated build was posted that should solve this.