I trying to update icons for shortcuts via a script.

I trying to update icons for shortcuts via a script.  I have a bunch of shortcuts in a panel, and I have several sets of icons that I use (just because I do).  The icons aren’t part of an icon pack, so I can’t just apply an icon pack to the panel, but instead set the icon individually for each shortcut.  I have the icon files named the same as the names I assigned to each of the shortcuts, and the following script mostly works to change update the icons, but it displays only a portion of the image from the file.  Is it L.createImage() which is the problem?  Do I somehow have to specify dimensions?

var APLight = LL.getCurrentDesktop().getItemByName(‘AppsPanelTheLight’);

var all = APLight.getContainer().getItems();

for(var i=all.getLength()-1;i>=0;–i)

{

var item = all().getAt(i);

var icon = LL.createImage(“/sdcard/Stuff/Icons/test22/” + item.getName() + “.png”);

item.setImage(icon); 

}

]]>

2 Commentsto I trying to update icons for shortcuts via a script.

  1. Anonymous says:

    < ![CDATA[

    Have you tried


    .setCustomIcon(icon);



    I’ve used that with no issues, what size are your icons?

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Thanks.  .setCustomIcon worked.  I could have sworn I tried that!

    ]]>

Leave a Reply

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