Hi Kei,
I assume that would work. But actually I adopted alastor933’s solution to hard code the expected return value of the duplicate command by adding " copy" to the end of the basename. It’s not ideal, because it doesn’t pick up the edge case of " copy 2", " copy 3" and so on, but it will work most of the time.
And Yvan? Sorry that I called you “Yves”.