TrianguloY your calendar icon script is not working on my app drawer
TrianguloY your calendar icon script is not working on my app drawer
Working fine on other shortcuts (other desktop)
Pierre Hébert so I have an issue with getElementById on my script
]]>
< ![CDATA[
Bruno-Isa LAMOUR-ARNOULD How is that script run? In the resumed event of the app drawer? Load event? Other?
Pierre Hébert the script runs LL.getEvent().getContainer().getItemByLabel(
so wherever that script is run, the event is not returning the container.
]]>
< ![CDATA[
Yes I was assuming this too. Now the key is to know when the script is run…
]]>
< ![CDATA[
Maybe resumed event as I said in one previous post?
]]>
< ![CDATA[
The strange thing is that Bruno’s modified script should work, as it is getting the items directly from their id :/
]]>
< ![CDATA[
let’s wait for Bruno-Isa LAMOUR-ARNOULD answer on the full context. It’s difficult to make assumption without knowing exactly how things are set up.
]]>
< ![CDATA[
At least it works out of the box for me, either from a desktop or in the app drawer, either from the resume event or the item menu (tried 4 combinations), script imported directly from the wiki.
]]>
< ![CDATA[
Bruno-Isa LAMOUR-ARNOULD, if I’m correct, you’ve been using that icon pack for a very long time, I’m lucky to go a couple days without changing at least icons lol I’m jus hyper i can’t leave anything alone. My parents were always having to replace any electronics in the house because I would take a screw driver to it lmao
]]>
< ![CDATA[
Pierre Hébert the error is when running the script from the item
My normal script is on Resumed event
Do you want my template ?
]]>
< ![CDATA[
Use the resume event of the container (the app drawer), not the item. Or use directly LL.getEvent().getItem().
]]>
< ![CDATA[
Pierre Hébert ok so it explains the error on appdrawer
But why my getElementById no more working ? 😕
]]>
< ![CDATA[
getItemById() does not work because it is called on a null object (the container for the event). The container is null when using the resume event of an item because it is not set in this context, and it is not set because there is no pertinent data here. If the container of the item need to be retrieved, the Item.getParent() can be used, duplicating the same data in LL.getEvent().getContainer() doesn’t bring any valuable information.
]]>
< ![CDATA[
I’ll keep that in mind for future scripts 🙂
]]>
< ![CDATA[
Pierre Hébert it was working on a previous version
]]>
< ![CDATA[
Bruno-Isa LAMOUR-ARNOULD if you check the instructions I gave in the script, it says to set it in the resumed event of the container.
I’m now not exactly sure if it worked before or not
]]>
< ![CDATA[
TrianguloY it was working : last succesful run was on 21st May. My Agenda icons were changed last time on 21 and were fine on my GNex where I didn’t install the llx update. Unfortunately I’ve updated this week
]]>
< ![CDATA[
Because it was working doesn’t mean it was right 😉 But if you follow TrianguloY instructions it will work again. It works for me.
]]>
< ![CDATA[
Pierre Hébert yes sure.
I have 3 agenda shortcuts : 1 in appdrawer, 1 in a folder and 1 in a desktop. Must I set 3 times the same script ? In all resumed
]]>
< ![CDATA[
If they all have the same label and icon, yes
]]>
< ![CDATA[
TrianguloY yes. Thank you for your help
]]>
< ![CDATA[
TrianguloY 1 instance was working fine.
Sure because of that :
/only when change, or run from item
if(now.toString()==LL.getScriptTag()&&LL.getEvent().getSource()!=”MENU_ITEM”)return;
LL.setScriptTag(now);
So i’m pretty sure I need 3 scripts.
Just duplicating seems fine : could you confirm about LL. setScriptTag ? (trying it now)
]]>
< ![CDATA[
TrianguloY commented the if
Fine now even the script is probably ran for nothing after the 3 update are done.
I prefer 1 script only for the same thing
Thank you for help and Pierre Hébert for explanation and your time and good work
]]>
< ![CDATA[
Hmm, you are right. With that code it will only run for the first item, not the others.
Commenting it is ok, the item is refreshed every time you open the container, but shouldn’t be a big issue.
]]>
< ![CDATA[
TrianguloY yes I can survive like that 😊
]]>