Try this:
Script
def transform(self, value, quality, timestamp):
indexes = value.selection.split('/')
itemPath = []
currentItems = value.items
for i in indexes:
i = int(i)
itemPath.append(currentItems[i].label)
currentItems = currentItems[i].items
return '/'.join(itemPath)
One of the Python guys should be able to reduce this to a couple of lines but this should give you something to work with in the meantime.
