I would really love to see dynamic text set by a script

I would really love to see dynamic text set by a script

I know I can edit a label, but that’s only a workaround 

]]>

21 Commentsto I would really love to see dynamic text set by a script

  1. Anonymous says:

    < ![CDATA[

    Something like an ‘always on’ timer.


    This will be extremely powerful, but a bit dangerous if the executed script is long/heavy…anyway this is something users need to know.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    The most important thing is when the script is executed. All scripts must be executed through an event, or possibly a timer, which has previously been set because of an event (either a user one or a generated one like load).


    Do you mean a dynamic text whose value will be evaluated on a regular basis ?

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Sorry, I don’t really understand your last sentence

    ]]>

  4. Anonymous says:

    < ![CDATA[

    This might well be because I didn’t understood your request 😉


    Why setting the label is only a workaround ? It is not so bad after all ?

    ]]>

  5. Anonymous says:

    < ![CDATA[

    I want a text which always shows the value of a variable in a script…



    Maybe you are right, I just use labels.


    It’s just the principle of using a shortcut to display text.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    But a problem with this is: item.getLabel() returns the default, not the current label.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Ok, but the issue is to know when to update the text with the value of the variable. And this can only be done because of some event. It is not possible to detect that a JavaScript variable has been updated somewhere else

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Maybe except if it  has been set with the persistent parameter to true (I didn’t checked this but I think it should behave this way)

    ]]>

  9. Anonymous says:

    < ![CDATA[

    I would like dynamic text to include the stock email app. I’m on GS4 4.4.2 AT&T.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Pierre Hébert I think the feature wouldn’t be bad to have, but is at any rate not important. 

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Silvia Rivera I am sorry but this is really not possible 🙁

    ]]>

  12. Anonymous says:

    < ![CDATA[

    What is the default value of a tag?


    “” or null or sth other?

    ]]>

  13. Anonymous says:

    < ![CDATA[

    This is null

    ]]>

  14. Anonymous says:

    < ![CDATA[

    Ok. And what returns JSON.parse(null) ?

    ]]>

  15. Anonymous says:

    < ![CDATA[

    Maybe it raises an exception, I don’t know. Have you something in mind?

    ]]>

  16. Anonymous says:

    < ![CDATA[

    var d=LL.getEvent().getContainer();


    if(d.getId()==-1)d=LL.getCurrentDesktop();


    if(d.getPositionScale()!=1)return;


    var data=JSON.parse(d.getTag());


    if (data==null || data.state==null)


    {


    data=new Object();


    data.state=0;


    data.running=false;


    }


    if(data.running==true)return;


    data.running=true;


    d.setTag(JSON.stringify(data));



    [code]




    data.running=false;


    d.setTag(JSON.stringify(data));




    A script, which allows only one execution per container and stores some other values in tag.

    ]]>

  17. Anonymous says:

    < ![CDATA[

    It does not work without the data.state==null.


    I wanted to know why.

    ]]>

  18. Anonymous says:

    < ![CDATA[

    Use this:


    d.getTag()||””

    ]]>

  19. Anonymous says:

    < ![CDATA[

    Syntax Error: empty JSON string

    ]]>

  20. Anonymous says:

    < ![CDATA[

    Correct is : d.getTag()||”null”

    ]]>

  21. Anonymous says:

    < ![CDATA[

    Oh, yes. Sorry

    ]]>

Leave a Reply

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