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!
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.
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…
< ![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!
]]>
< ![CDATA[
Thomas Greer I know how to do it manually.
I want to do it through a script 😁
]]>
< ![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.
]]>
< ![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…
]]>
< ![CDATA[
TrianguloY Thanks, I will try that.
No I am not looking for Dynamic Text.
]]>
< ![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);
]]>
< ![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);
]]>
< ![CDATA[
Check http://www.pierrox.net/android/applications/lightning_launcher/script/reference/net/pierrox/lightning_launcher/script/api/PropertySet.html and http://www.pierrox.net/android/applications/lightning_launcher/script/reference/net/pierrox/lightning_launcher/script/api/PropertyEditor.html
]]>
< ![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();
]]>
< ![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();
}}
]]>
< ![CDATA[
Abdullah Alahdal good, what exactly does the script? (I could guess from the code, but better that you tell us)
]]>
< ![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.
]]>