Drop text file to Dock icon

If have an app that has a TextArea on Window1. In the app.open event I read the dropped file with TextInputStream. Also I have created a FileTypeSet with:
text/plain - Text - TEXT - ??? - .asc;.ascii;.bas;.c;.class;.cp;.cpp;.h;.hp;.hpp;.i3;.java;.m2;.m3;.mak;.text;.txt - public.text
And I have set the file type drop under build settings for OS X for MyApp.Text. When I rund the app and drop a file to the dock icon, the open document is not working. When I add a new file type “special/any - Any - ??? - ???” and activate this in the build settings, the file drop to the dock item works and the text is placed into the TextArea on Window1. But file type “Any” allows the user to dop any file (picture, apps, etc). When a user drops an picture to the dock icon, the string of the picture are in the TextArea on Window1. This is not good.

Here are my questions:

  1. What can I do that the file type for text files only is working?
  2. If this is not possible, how can I check if a dropped file ist a pure text file?

Nobody has an answer?

Have you tried to put only public.text in your FileType ?

Yes, and this will not work. If this is set, you can’t drop a text file to the dock icon.

Then you can still check for the extension .TXT, right ?

Yes, add “File Type Set”, add
Display Name - Object Name - Mac Type - MacCreator - Extensions - UTI’s
text/plain - Text - TEXT - ??? - .asc;.ascii;.bas;.c;.class;.cp;.cpp;.h;.hp;.hpp;.i3;.java;.m2;.m3;.mak;.text;.txt - public.text

And than in the build settings for OS X, File Types => Choose => activate FileTypes1.Text (Role = None)

Late to the party, but you need to set the role to something other than none.

I have set the role to “Viewer” and now it works. Thank you

Glad it helps :slight_smile: