How to not get rtf with filetype set to .txt

I hope there is another way around this problem. I finally clicked on an rtf file in OpenDialog during debugging and my app tried to open it.
I am confused because I have, in the FileType Editor, text set to the extension .txt .
Do I have to add in exclusions in an extensions test like csv rtf and other things or…??

Change the FIles Type to this

Did you set the OpenDialog filter property to only your .txt file Type?

Roger: channel name is MacOS. Works better on WIndows.

Yes. I have

dlg.Filter = "Text" //displays open-file dialog

For Text in the FileType Editor I had/have:
I HAD for the UTI Plain.text and now nothing.
I have NOW for Display name text/plain
File extension is .txt
OS type is TEXT

I’m also using XOJO 2018 r1.1 and High Sierra.
Without the UTI it still allows selection of an rtf

I also tried for the UTI


instead of public.text
which I got from the Apple page Uniform Type Identifiers Overview

When I have issues with FileTypes I create an object in code right before the open dialog and that seems to help.

[code]dim ftTXT as new FileType
ftTXT.Extensions = “.txt”
ftTXT.Name = “Text”

dim dlg as new OpenDialog
dlg.Filter = ftTXT

Thanks. Interesting solution