DropUNIX starts with a standard C program that you want to port to the MacOS. That program needs to be in source form, and needs to be able to compile on a MacOS C compiler. DropUNIX will give it a drag and drop interface with one line added to the source file containing your main() function.
To use, simply add an #include to the DropUNIX header “Main.h”. This will convert your main() into Main(). This new function will be called via DropUNIX when your app gets notified of an event to process. This can be triggered from an open menu selection or via drag and drop in the finder.
The only other thing you need do now is to let the finder know that you can process drag and drop AppleEvents. All of this is done in the DropUNIX project and resource file shipped. Here is a list of what must be set:
- The isHighLevelEventAware flag must be set in your compiler project.
- You should also have the ‘aete’ resource for the core Apple Events.
- You should have a ‘BNDL’ resource (#128) that matches the creator signature that the compiler is set to.
- To process all regular files, the ‘BNDL’ should list a ‘**’ type.
- To process folders, it should list a ‘fold’ type. Remove this to disable folder processing.
- To process disks, it should list a ‘disk’ type. Remove this to disable disk processing.
Now all you do is recompile and link your app.