Hi,
I've not tested this, but it will be something like this:
var elemDef = app.ActiveDoc.GetNamedElementDef('FooBar');
var attrDefs = elemDef.AttributeDefs;
for (var i = 0; i < attrDefs.length; i++) {
if (attrDefs[i].name === 'product') {
attrDefs[i].attrType = Constants.FV_AT_STRINGS;
}
}
elemDef.AttributeDefs = attrDefs;