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:
- What can I do that the file type for text files only is working?
- If this is not possible, how can I check if a dropped file ist a pure text file?