Add metadata saving to the split script