I realize my precedent post is a little bit confused.
Let’s take another example with a command to change the extension in a path:
on path change extension thePath newExtension newExt full path fullPath
As it’s changing the path, it’s obvious it must return a path.
But some times, we only need the name.
For that, we could have another command or ask for the last component.
I find that an optional parameter is more adequate.