Hi,
You can do something like below
path = "/content/dam/myproj"
renditionsNodeName = "renditions"
renditionsPath = "/renditions/"
NT_FILE = "nt:file"
renditionsNodeFound = 0
getNode(path).recurse { node ->
if(node.name == renditionsNodeName){
renditionsNodeFound++;
}
else if (node.path.contains(renditionsPath) && node.getPrimaryNodeType()==NT_FILE) {
node.remove();
}
}
println "\n ${renditionsNodeName} count = ${renditionsNodeFound}"
save()
Note: This is not tested and could have compilation or logic issues.
Arun Patidar