How to do naming rule by script in any doctypes?

Screenshot from 2024-05-22 17-21-54

Check the contact creation example.

Code: