When renaming a template file, the extension defaults to .txt

I’ve created a Rtemplate.R template file, with the intent to create Rstudio scripts for data analysis.

When I create a new file with ‘new from template’ the file is created and the type is properly assigned - I can open it in Rstudio and it is recognized as an R file.

However, when I then rename the file in the DTP database, the extension is automatically changed from .R to .txt. Is there any way to prevent this from happening and preserve the .R extension while renaming files?

See hidden preference AdditionalPlainTextExtensions in appendix of help.

This worked like a charm!

lodewijk@iMac ~ % defaults read com.devon-technologies.think3 AdditionalPlainTextExtensions

2023-06-06 20:22:39.507 defaults[47160:1127323]

The domain/default pair of (com.devon-technologies.think3, AdditionalPlainTextExtensions) does not exist

lodewijk@iMac ~ % defaults write com.devon-technologies.think3 AdditionalPlainTextExtensions -string .R.Rd

and I restarted DTP to be sure