folderitem.name

I have a file (“myfile”) which is a JPG image. If I use myfile.name=newname, it converts my file to a Textedit file. How else can I change the name?
Configuration: Mac OS Catalina, Xojo 2019 release 2

It only changes the name, not the content.

if there is no extension, its anybody’s guess what type of file it is, since Macs no longer use the resources to identify file types.
Just make sure the name ends with .jpg