Hi, I was wondering how to make a link placeholder via a script?

Hi, I was wondering how to make a link placeholder via a script? The idea is that when you click on that particular placeholder it opens that link, then when you long tap it you can change the link to a new one. Thanks!

]]>
« (Previous Post)

10 Commentsto Hi, I was wondering how to make a link placeholder via a script?

  1. Anonymous says:

    < ![CDATA[

    Try this:



    Set this script in the long tap event of an item. Leave the tap as default.



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


    var link=prompt(“Write a link:”,item.getIntent().getData());


    if(link==null) return;


    item.setIntent(new Intent(Intent.ACTION_VIEW, Uri.parse(link)));


    item.setLabel(link);

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Thanks TrianguloY​​! Tried it and was able to change the link. When I click on the new link however, it does not proceed to Chrome. Instead there is a pop-up saying “Item is not installed. Proceed to Google Play or pick another app?”

    ]]>

  3. Anonymous says:

    < ![CDATA[

    But does it open another app? Or simply nothing happens?


    Make sure the tap event is ‘unset’

    ]]>

  4. Anonymous says:

    < ![CDATA[

    There is a pop-up saying “Item is not installed. Proceed to Google Play or pick another app?” The tap event is unset.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Hmm, does it happens with all links?


    Try with


    http://www.google.com

    ]]>

  6. Anonymous says:

    < ![CDATA[

    It worked! Thanks TrianguloY​! Didn’t realize I had to input the whole link as I was only putting “http://www.google.com

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Tweaked it a little bit to also prompt for a new label:




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


    var link=prompt(“Write a link:”,item.getIntent().getData());


    if(link==null) return;


    item.setIntent(new Intent(Intent.ACTION_VIEW, Uri.parse(link)));


    var label=prompt(“Write a label:”,item.getIntent().getData());


    item.setLabel(label);



    After you click it once to load the link however, the label doesn’t stick although the link seems fine.

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Nice! It’s good that you take that script as a base to create your own personal script.


    For the label use item.setLabel(label,true); to make it persistent.

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Thanks again TrianguloY​! Tried again and it worked.



    P.S.


    Change the link first, don’t leave it as it is, even if it was already the link you want to input, or else the label won’t persist. Happened to me the first few attempts hahaha

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Nice Idea this

    ]]>

Leave a Reply

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