In Finder, if you right click a file → Get Info, you will see a checkbox in the Name & Extension section that offers users the ability to Hide extension.
If you press Command (⌘)-Shift-3 to take a whole-screen screenshot on your Mac, a screenshot is saved as a .png file. By default, the .png extension for a screenshot is hidden.
Can I change this hide extension status using AppleScript?
If you are curious as to why I'm trying to perform this action in AppleScript, it is because I have a script that involves taking & saving a screenshot, and then naming the file based on the text on the clipboard. And, in this process of renaming the file, Finder no longer recognizes the file as a .png file, so I have to manually change the filename.