Script to launch Tasker task not working on latest beta. Here’s my code – any suggestions?

Script to launch Tasker task not working on latest beta. Here’s my code – any suggestions?

var i = new TaskerIntent(“Listen”);

i.addParameter(LL.getEvent().getItem().getLabel());

LL.sendTaskerIntent(i, true);

]]>

20 Commentsto Script to launch Tasker task not working on latest beta. Here’s my code – any suggestions?

  1. Anonymous says:

    < ![CDATA[

    I’m facing the same issue. I thought something wrong with my code.



    var item = LL.getEvent().getItem()


    var tag = item.getTag(“Record_ID”);




    var i = new TaskerIntent(“Run_Task”);


    i.addAction(ActionCodes.RUN_TASK);


    i.addArg(“Delete Record”);


    i.addArg(“%priority”);


    i.addArg(tag);


    LL.sendTaskerIntent(i, true);

    ]]>

  2. Anonymous says:

    < ![CDATA[

    I don’t get any issue on my side. I tried with various combinations, including the sample code here: http://www.lightninglauncher.com/wiki/doku.php?id=working_with_tasker


    Does the sample work for you?


    Do you get an error message somewhere or does it fail silently? sendTaskerIntent() should return false in case of error.

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Pierre Hébert​ I get the error ‘Failed to execute broadcast task’



    Update: the sample works without problem.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    This message is displayed by Tasker, so this mean that it is receiving something at least.



    This probably mean that this “something” is broken, but at the moment I don’t get why and what. I’ll test with older versions to check the previous behavior.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Sample script doesn’t work for me. i get a silent error, the “done” message appears only after i initiate another action in Tasker manually

    ]]>

  6. Anonymous says:

    < ![CDATA[

    That may be because the speech synthesis engine used in the example is slow to start, or is downloading language data.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    What do you get if in Tasker you activate the debug options in the preferences screen ? Could you share the content of the sd card “/Tasker/log.txt” file please ?

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Nothing appears on tasker, but have emailed you the logs separately…

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Tasker task initiation seems to be broken for all my scripts…

    ]]>

  10. Anonymous says:

    < ![CDATA[

    What if you try this ? (This is a simpler test)


    var i=new TaskerIntent(“X”);


    i.addAction(ActionCodes.VIBRATE);


    i.addArg(500);


    sendTaskerIntent(i, true);

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Pierre Hébert phone vibrates.

    ]]>

  12. Anonymous says:

    < ![CDATA[

    That’s good because it works. That’s not good because I don’t know why this call would work and not the others.

    ]]>

  13. Anonymous says:

    < ![CDATA[

    I was trying to perform task from LL. Hence, my workaround is as follows:



    Instead of:



    var i = new TaskerIntent(“Run_Task”);


    i.addAction(ActionCodes.RUN_TASK);


    i.addArg(“Delete Record”);


    i.addArg(“%priority+1”);


    i.addArg(tag);


    i.addArg(“”);


    i.addArg(“”);


    i.addArg(false);


    LL.sendTaskerIntent(i, true);




    I may use this:




    var i = new TaskerIntent(“Set_VAR”);


    i.addAction(ActionCodes.SET_VARIABLE);


    i.addArg(“%Record_ID”);


    i.addArg(tag);


    i.addArg(false);


    i.addArg(false);


    LL.sendTaskerIntent(i, true);




    LL.sendTaskerIntent(new TaskerIntent(“Delete Record”),false);




    PS. AFAIK, Tasker will keep Global variable for available variable actions only, hence, I made a dummy task called “Vars for LL” and I will just put the action Set Variable and set an empty variables to preserve the variables in Tasker.

    ]]>

  14. Anonymous says:

    < ![CDATA[

    I am confused: is this a Tasker or Lightning issue? As far as I can see tasker intents are sent and received correctly?


    Wern-Yuen Tan maybe this is a dumb question, but could you verify whether “Allow external access” is enabled in Tasker / Preferences / Misc.


    Anybody else having similar issues?

    ]]>

  15. Anonymous says:

    < ![CDATA[

    For me different scenarios work perfectly. But RUN_TASK returns the error.

    ]]>

  16. Anonymous says:

    < ![CDATA[

    Pierre Hébert i always had “allow external access” enabled. LL can launch Tasker tasks via shortcuts, but somehow using script to launch tasks is broken. it worked on the previous build, though

    ]]>

  17. Anonymous says:

    < ![CDATA[

    Flash, Set Variable and Say. All these actions work for me through Script. But Perform Task (RUN_TASK) does not.

    ]]>

  18. Anonymous says:

    < ![CDATA[

    I believe your issues are two distinct issues.



    Abdullah Alahdal in your case Tasker receives the command. Why the RUN_TASK action doesn’t work remain a mystery since other actions work. I can only suggest to activate Tasker log and look for the lines related to the error. You can send it to me if you wish (clear it before to test so that it’s not too big please). There will be some mentions about the action and its arguments, this will enlighten us about exchanged data and result.



    Wern-Yuen Tan as I understand in your case Tasker doesn’t receive anything. The only reason I am aware of is this external access setting, that’s why I asked about it. Regarding the LL tasker API, it is third party code (provided by Tasker) and there has been no update to it. In addition it works reliabily on all my devices so I can’t find the start of an explanation why it would fail 🙁 Please tell me what is the result of these two scripts:



    First:


    var i=new TaskerIntent(“X”);


    i.addAction(ActionCodes.VIBRATE);


    i.addArg(500);


    alert(sendTaskerIntent(i, false));



    Second;


    var i=new TaskerIntent(“X”);


    i.addAction(ActionCodes.VIBRATE);


    i.addArg(500);


    alert(sendTaskerIntent(i, true));



    Both are most basic test I could find (they eliminate context issues) and differ only by the synchronous parameter.


    If the first one doesn’t work then I have no other suggestion.


    If the first one works, but not the second, then it may depend on the script execution context, and I’ll need deeper knowledge of it


    If the two scripts work, then I don’t know why all other tasker invocation would fail.

    ]]>

  19. Anonymous says:

    < ![CDATA[

    I try the first and not working, Pierre Hébert did you found something related to this?

    ]]>

  20. Anonymous says:

    < ![CDATA[

    Gabriel Garcia as I understood this is due to update in Tasker variables structure.

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *