Ah, of course, @dlaidler, sorry, that's just the index in the array.
To get the ID that corresponds to the UI, you need to use the following expression in place of that simple d reference:
utag.handler.cfg_extend[d].id
That'll perform a lookup to the corresponding config entry and retrieve its source ID.
On the question of tag-scoped extensions, I think the following code should work:
for(var tag_id in utag.sender){
var this_tag = "" + tag_id;
var reducer = function(extension_list, next_extension){
extension_list.push(next_extension);
extension_list.push(function(a,b){
utag.extension_log.push({
id: "Tag: " + this_tag,
code: next_extension.toString(),
udo: JSON.stringify(b)
});
});
return extension_list;
};
if(utag.sender[tag_id].extend){
utag.sender[tag_id].extend = utag.sender[tag_id].extend.reduce(reducer,[]);
}
}
There's nothing to link back to the ID in the UI, the tag scoped extensions don't make any mention of it anywhere so there's no way to access that, but effectively what we're doing here is iterating through the array of tag scoped extensions for each tag, and then creating a new array which alternates between running the extension, and simply dumping the UDO into the previously created utag.extension_log array along with the code for that extension.
Edit: That "this_tag" bit doesn't work, never was any good at remembering how to make the iterating key persist in scope for use later, but in general the whole thing still works, it'll just misattribute all your extensions to the last tag unless you fix that bit....
... View more