Could use some help :) <<Unknown system exception>>
i am currently messing around with max script a bit, trying to understand it and learn the commands, so i'm really new to this. For training i wrote this small script:
macroScript checkSelCount category:"Custom"
rollout checkSelCount "checkSelCount" width:132 height:63
edittext edt " " pos:[4,5] width:116 height:22
button btn "Update selection" pos:[3,33] width:122 height:23
fn check_sel_count = (
if selection.count == 0 then
checkSelCount.edt.text = "Nothing selected" else
if selection.count > 1 then
checkSelCount.edt.text = "Multiple selected" else
checkSelCount.edt.text = "''" + $.name as String + "''" + " selected"
on btn pressed do
createDialog checkSelCount 132 63
checkSelCount.edt.readOnly = true
It should simply print out in the edittext-field if nothing, one or multiple objects are selected (on start or when i hit the update button. I already had this working, but after i restarted max, i got lots of errors with undefined properties and after changing the order of some things, i now always get a an "unknown system exception".
I guess it's really simple to solve, but i'm stuck. Any ideas? And is there a better way to check if anything has been selected? And why do i sometimes get a Number in the Listener after evaluating my script, instead of "OK"?