No, this can be done without scripting of some kind . There aren’t conditionals in a smart group and a RegEx isn’t going to return a value that would produce zeropadding or not when using the capture groups.
This is unlikely. But you understand Python and not AppleScript?!? That always boggles my mind since AS is such a simple language to learn.
There’s a lot that’s unfamiliar to me in the AppleScript paradigm, given that I started programming in 1976. I’ve worked a little with some really unusual languages like APL and Smalltalk and even a little with more obscure approaches like ProGraph, but AppleScript just seems really cumbersome and wordy, along with dealing with so many kinds of objects and all their attributes.
Maybe I need to look at more DEVONthink-oriented AppleScript?