Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

ScriptUI CS6 on Mac: listbox crashes app?

$
0
0

I have a very unique problem which I would have never known about because I do not have CS6 on the Mac: this very simple dialog seems to crash the entire application after it is dismissed. The only special thing about it that I can assume is the presence of a multi-column listbox with headers? It definitely works in CS5 and CC on Mac and Windows, and, as far as I am aware, on all versions on all Windows. This seemed so unlikely, and I am as happy about this being brought to my attention as I am dismayed that it's a real issue! How weird, what can be changed in this code to make it not crash?

 

 

Crashed Thread:  0  Dispatch queue: com.apple.main-thread


Exception Type:  EXC_BAD_ACCESS (SIGBUS)

Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000145e3fc48

 

#target illustrator
function test(){    function fillMyList(list){        var newItem;        if(list.items.length > 0){            list.removeAll();        }        for(var i=0; i<100; i++){            newItem = list.add("item");            newItem.text = "Hello " + (i + 1);            newItem.subItems[0].text = "A" + (i + 1);            newItem.subItems[1].text = "B" + (i + 1);        }    };    function UIWindow(){        var w = new Window("dialog", "test");        var g0 = w.add("group");        g0.orientation = "stack";        var g1 = g0.add("group");        g1.orientation = "column";        var btn_test = g1.add("button", undefined, "Test");                       var mylist = g1.add("listbox", undefined, [], {            numberOfColumns: 3,            showHeaders: true,            columnTitles: ["Col-1", "Col-2", "Col-3"],            columnWidths: [150, 100, 220]        });        mylist.size = [300, 200];               btn_test.onClick = function(){            fillMyList(mylist);        }               var g_btn = g1.add("group");        g_btn.spacing = 4;        var btn_ok = g_btn.add("button", undefined, "Ok");        var btn_ccl = g_btn.add("button", undefined, "Cancel");               if(w.show() == 2){            return "Cancelled";        } else {            return "Proceed";        }    };    var myData = UIWindow();    alert(myData);
}
test();

Viewing all articles
Browse latest Browse all 12845


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>