I saw that post of yours. Wasn't quite smart enough to know what to modify in there and whether I could get it to populate a field with a Yes/No or 1/0 so i could reference later?
you don't need to change anything in there. just pass in your custom class configured for attachment control.
the function is primarily meant to use in rules, calc value controls or in JS scripts. but it shouldn't be a problem to customize it to (re)set some control's value.