Copy link to clipboard
Copied
Hi All,
I have a "product" attribute on an element that is set as a String in the EDD. I want to dynamically change it to a Strings type in the document. I have some code I have been playing with, but it is not quite ready for the world to see--and besides, it doesn't work. Has anyone done a task like this in ExtendScript or the FDK that could share some pointers? Thank you in advance.
-Rick
Copy link to clipboard
Copied
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;