Error loading external items in listbox
Hello everyone once again! I'm working a dialog window containing a listbox that loads an external list.txt with icones.png, but today I've been getting an error message:
myList.items .image = File ("~ / Desktop / Icons /" + imgs );
Guys can anyone test my script and check for the cause of the error.
My version of Photoshop:
Adobe Photoshop Version: 20.0.0 20180920.r.24 2018/09/20: 1193433 x64
var aFile = File ( "~/Desktop/ListIcons.txt" );
aFile.open('r'); var stringFromTextFile = aFile.read(); var imgs = stringFromTextFile.split("\n");
var w = new Window("dialog");
var myList = w.add("listbox");
for (var i = 0; i < imgs.length; i++) {
myList.add("item");
myList.items.image = File("~/Desktop/Icons/"+ imgs);
}
myList.preferredSize = [120,190];
w.show();
Here lists and icons:
listbox teste https://www.mediafire.com/file/zo6yjfmh8cprz9z/listbox_teste.rar/file