Delete unused-variables
Unfortunately the UI- and the Handling of variables is quiet different to all other menues and function in InDesign. And so theres still no way to delete "unused" variables.
While handling an document over several years - e.g. a typical product-catalog or price list - the variables-list grows from year to year as there are every year new products which need a variable. After some years it is not practical to have a list with 500 variables but only 100 are used.
It would be very appreciated if the complete handling of variables could be like in all other menues.
-
Valeriy commented
for (var i = 0; i < app.activeDocument.textVariables.length; i++){
var instances = app.activeDocument.textVariables.item(i).associatedInstances;
if (!instances.length){
app.activeDocument.textVariables.item(i).remove();
i--;}
}