hey guys, i am trying to get a missed whatsapp counter as a label via tasker.
i have a tasker profile wich adds +1 to a variable and this variable gets picked up by the zooper variable.
so far so good.
i used
https://www.youtube.com/watch?v=nnJQ5N8PXi8
to get this variable as a label and it works. But when i place the item inside a panel i cant get it to work.
i use
this works for the item wich isnt inside a panel.
LL.getCurrentDesktop().getItemByName(“LLXwapp”).setLabel(LL.getEvent().getData(),false);
for the item inside a panel named “left”
i get Type error Cannot find function getItemByName in object Panel 65579.
LL.getCurrentDesktop().getItemByName(“left”).getItemByName(“LLXwapp”).setLabel(LL.getEvent().getData(),false);
from the API:
getItemByLabel(String label)
This method is deprecated. No replacement.
so this doesnt work
The script gets triggered by the tasker event.
so basicly i just need to get the item inside the panel 🙂
a really simple thing
]]>
< ![CDATA[
You need to replace:
getItemByName(“left”).getItemByName(“LLXwapp”)
with:
getItemByName(“left”).getContainer().getItemByName(“LLXwapp”)
The object returned by getItemByName(“left”) is an item of kind “Panel”, and on this item you need to access the container, holding other items.
getItemByLabel(String label) is deprecated but as long as it is in the API doc it will work, don’t worry about it too much.
]]>
< ![CDATA[
Thanks Piere I will try this in about half an hour and let you know if it works
]]>
< ![CDATA[
Woehoe it worked thanks Pierre Hébert and thanks Evelien Wijbenga ( i thought it was your tutorial =) ) for the tutorial
]]>
< ![CDATA[
Thanks Maarten H
Sometimes if I restart LL or when restarting device I loose the text in the items, to prevent that the persistent flag had to be set to true instead of false :
setLabel(“label”, true)
This was not in the video found out later.
]]>
< ![CDATA[
oh oke thanks for the tip. it hasn’t happened yet. But its good to all ready have a solution
]]>