Is there a script to create a text item inside a panel.

Is there a script to create a text item inside a panel. I have gone through the wiki but couldn’t find anything to create a new text item.

]]>

12 Commentsto Is there a script to create a text item inside a panel.

  1. Anonymous says:

    < ![CDATA[

    Long press an empty space inside your panel in edit mode. When the menu pops up, there should be a square icon in the middle, at the top, with a “+” inside. Select it, and the add menu should pop up. The first row will have the plain text option, and second row will have the dynamic text option. Hope this helps!

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Thomas Greer​ I know how to do it manually.



    I want to do it through a script 😁

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Abdullah Alahdal oh, I’m sorry, I must have misread your post. I’ll look and see if I can find anything in my notes about creating a new item from script.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    A text item is a regular shortcut with icon hidden. Search in the container api for the exact function to create a shortcut, then in the propertySet/propertyEditor to hide the icon.



    But if you mean a dynamic text, I can be wrong but I think that’s not possible…

    ]]>

  5. Anonymous says:

    < ![CDATA[

    TrianguloY Thanks, I will try that.


    No I am not looking for Dynamic Text.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    As I’m a newbie I took some time to achieve adding a shortcut to the panel using a script. Any reference how to change/remove the icon.



    var e=LL.getEvent();


    var c=e.getContainer();


    var pnl = c.getItemByName(‘pnlTasks’).getContainer();


    var i = new Intent(Intent.ACTION_MAIN);


    var newitem = pnl.addShortcut(“Test”,i,0,0);

    ]]>

  7. Anonymous says:

    < ![CDATA[

    I’ve tried removing the icon with setDefaultIcon(null) but it is not working.



    My current code:



    var e=LL.getEvent();


    var c=e.getContainer();


    var pnl = c.getItemByName(‘pnlTasks’).getContainer();



    var i = new Intent(Intent.ACTION_MAIN);



    var newitem = pnl.addShortcut(“Test”,i,0,0);



    var items = pnl.getItems();



    var noitems = items.length – 1;



    newitem.setName(“Task ” + noitems);



    newitem.setPosition(0, noitems);



    newitem.setDefaultIcon(null);

    ]]>

  8. Anonymous says:

    < ![CDATA[

    I did it 😁, it was a good journey



    var name = prompt(“What is your name ?”, “your name here”);



    var e=LL.getEvent();


    var c=e.getContainer();


    var pnl = c.getItemByName(‘pnlTasks’).getContainer();



    var i = new Intent(Intent.ACTION_MAIN);



    var items = pnl.getItems().length;



    var newitem = pnl.addShortcut(name,i,0,0);



    newitem.setName(“Task ” + items);



    newitem.setPosition(0, items);



    newitem.getProperties().edit().setBoolean(“s.iconVisibility”, false).commit();

    ]]>

  9. Anonymous says:

    < ![CDATA[

    With thanks to TrianguloY  This is my current code.



    Excuse me for coding as  newbie. Any advice is welcome.



    var e=LL.getEvent();


    var c=LL.getCurrentDesktop();


    var pnl = c.getItemByName(‘pnlPersonal’).getContainer();



    //remove existing


    var items = pnl.getItems().length + 1;


    for (i = 1; i < items; i++) {


    var remitem = pnl.getItemByName(“Item”+i);


    pnl.removeItem(remitem); }



    //Get data from Tasker


    var items = e.getData();


    var itemsarr = items.split(“~”);


    var totitems = itemsarr.length;



    //Shortcut class assignment


    var i = new Intent(Intent.ACTION_VIEW);


    if (itemsarr[0] == “LLTasks”) {


        i.setClassName(“com.ninefolders.hd3”, “com.ninefolders.hd3.activity.TodoActivity”);


    } else if (itemsarr[0] == “LLEmails”) {


        i.setClassName(“com.ninefolders.hd3”, “com.ninefolders.hd3.activity.MailActivityEmail”);


    } else {    i.setClassName(“com.google.android.calendar”, “com.android.calendar.LaunchActivity”);


    }




    //Items creation and format


    if ((itemsarr[0] == “LLCalendar” && itemsarr[1]!= “No Upcoming Events”)) {



    for (m = 1; m < totitems; m++) {



    var event = itemsarr[m];


    var eventarr = event.split(“|”);



    if (eventarr[4] == 0) { var apptime = eventarr[2]+”-“+eventarr[3] } else {apptime =”Full Day”}



    var vpos = pnl.getItems().length;


    var newitem = pnl.addShortcut(eventarr[1]+” “+eventarr[6]+”\t\t\t\t\t\t\t\t”+eventarr[0]+”\n”+apptime+”\t\t\t\t\t\t”+eventarr[5],i,0,0);


    newitem.setName(“Item” + m);


    newitem.setPosition(0, vpos);



    newitem.getProperties().edit()


    .setBoolean(“s.iconVisibility”, false)


    .setBoolean(“s.labelShadow”, false)


    .setInteger(“s.labelFontColor”, 0xff000000)


    .setInteger(“s.labelMaxLines”, 2)


    .setString(“s.labelFontStyle”, “BOLD”)


    .commit();


    var editor = newitem.getProperties().edit();


    var box = editor.getBox(“i.box”);


    box.setAlignment(“LEFT”,”MIDDLE”);


    box.setSize(“bb”, 1)


    editor.commit();



    }



    } else {


    for (m = 1; m < totitems; m++) {


    var vpos = pnl.getItems().length;


    var newitem = pnl.addShortcut(itemsarr[m],i,0,0);


    newitem.setName(“Item” + m);


    newitem.setPosition(0, vpos);



    newitem.getProperties().edit()


    .setBoolean(“s.iconVisibility”, false)


    .setBoolean(“s.labelShadow”, false)


    .setInteger(“s.labelFontColor”, 0xff000000)


    .setString(“s.labelFontStyle”, “BOLD”)


    .commit();


    var editor = newitem.getProperties().edit();


    var box = editor.getBox(“i.box”);


    box.setAlignment(“LEFT”,”MIDDLE”); 


    editor.commit();


    }}

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Abdullah Alahdal good, what exactly does the script? (I could guess from the code, but better that you tell us)

    ]]>

  11. Anonymous says:

    < ![CDATA[

    TrianguloY  First I am using Tasker with SQLite command to read some information such as Tasks, Emails & Events. Then I run a script with data


    You may have a look into this short video https://plus.google.com/+AbdullahAlahdal/posts/c72drf26BQe which I shared couple of days ago. The overall look has been changed a little bit as I am improving the code whenever possible.

    ]]>

Leave a Reply

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