I have an applescript-objective-c application created in Xcode. In the main window, I have a text field which does contain the path to a file (which will later on be processed). I also have a button which opens an Open File dialog to get that path.
What I now would like to make is the ability for the user to drag a file onto that field, and have its path displayed (as POSIX path).
Any help to accomplish this, or to the right place to find out more is highly appreciated.
If you drag in an NSTextView instead of an NSTextField, you get the drag-and-drop of files with it for free. Another alternative is to use anNSPathControl.
That doesn’t mean you can’t do it with a text field – but it is reasonably complicated.