getContainer() is not necessarily the container for the item, this is the “target” container (the active one from the user point of view). I don’t remember when this target is reset, but maybe it has never been set before the item paused/resumed events are fired.
Does it makes the same error if you run the script from the pop-up menu?
What surprises me is the fact that it doesn’t say ‘can’t find method X in shortcut Y‘ Pierre Hébert what can cause the error to not be shown this way?
< ![CDATA[
Here is the script
//go to the icon picker and search the 31 items. Long click the first one (it will be copied) and paste it here between the brackets
var link = [ “com.esethnet.vion”, “google_calendar_1” ]
//write true to set the calendar based on the month. By default it’s false: based on the day
var month=false;
//end of config
if(link.length==0){alert(“follow the instructions and paste the icon properties in the script”);return;}
LL.bindClass(“java.util.Calendar”);
var now=Calendar.getInstance().get(month?Calendar.MONTH:Calendar.DAY_OF_MONTH);
if(month)now++;
//only when change, or run from item
if(now.toString()==LL.getScriptTag()&&LL.getEvent().getSource()!=”MENU_ITEM”)return;
LL.setScriptTag(now);
var iconPackName = link[0];
var prefixName = link[1].substring(0,link[1].length-1);
var item=LL.getItemById(0x640006);
if(item!=null){
var icon=LL.createImage(iconPackName,prefixName+now);
if(icon==null){alert(“no icon found, make sure the pasted data is right and the icon pack have it”);return;}
item.setCustomIcon(icon);
}
item=LL.getItemById(0x010007);
item.setCustomIcon(icon);
item=LL.getItemById(0x7e0006);
item.setCustomIcon(icon);
]]>
< ![CDATA[
Worki’g fine on older LLx bersion
]]>
< ![CDATA[
Could you check that your ids (0x010007, 0x7e0006) are still valid shortcuts ? Maybe they are not up to date and refer to other items.
]]>
< ![CDATA[
Pierre Hébert! Because of this I discovered another bug:
Now, LL.getEvent().getContainer() returns null when the script is run in the resumed or paused event of an item
]]>
< ![CDATA[
getContainer() is not necessarily the container for the item, this is the “target” container (the active one from the user point of view). I don’t remember when this target is reset, but maybe it has never been set before the item paused/resumed events are fired.
]]>
< ![CDATA[
Pierre Hébert but previously it was the container of the item right?
In that case I need to modify some scripts…
]]>
< ![CDATA[
Hum, not sure… I believe this was a coincidence, or maybe I changed something regarding when the target container is set.
I had to rework this a bit for v12.4, it might well be that some minor change in behavior has gone unnoticed.
]]>
< ![CDATA[
Pierre Hébert yes my ID are fine
]]>
< ![CDATA[
Does it makes the same error if you run the script from the pop-up menu?
What surprises me is the fact that it doesn’t say ‘can’t find method X in shortcut Y‘ Pierre Hébert what can cause the error to not be shown this way?
]]>
< ![CDATA[
TrianguloY where do you see In Shortcut ?
]]>
< ![CDATA[
I don’t see it, that’s what surprises me.
Normally, when a method is not found it says ‘can’t find method X in Y’
But in your case the ‘in Y’ is not shown…
]]>
< ![CDATA[
TrianguloY ah OK.Maybe a bug : before some versions it worked
]]>