Answered
Script to convert shape rounded rectangle to rectangle
I hope the JavaScript implementation
thank!

I hope the JavaScript implementation
thank!

If you wish to create or modify a rectangle with rounded corners, you will have to add/remove the extra path points and set their Bezier handles yourself.
https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints.html
That is how the corner rounding options in Properties panel really does it, which you can check:
alert(app.activeDocument.pathItems[0].pathPoints.length)
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.