I think I am getting close to figuring out a workaround to this problem. The problem, from what I can tell after some experimentation, is that the drag and drop feature is not well supported in applescript. It has some serious memory issues. What is happening when your drop something on an object, is that it is for whatever reason demanding a lot of system resources throughout the duration of the drop handler (i.e. everything you have between ‘on drop’ and ‘end drop’). The errors and crashes we’ve been getting are caused by an overload of the system. I’m sure you’ve found that removing any ‘tell application’ statements solves the crashes, because telling another application to do something is just too much to do, with the added overhead of having your app caught in a fatal loop. Unfortunately, removing the tell statement leads to losing the mechanism for doing your processing 
The ‘solution’ I have found, does require an extra step on the part of the user, but the way I’m doing it now makes it pretty easy. First, I have switched to a rounded bevel button instead of an image view to drop objects onto. You can still use an image view if you want, but a button is nice because it also allows you to customize the picture in the “Drop Zone” while giving you an added bonus which I’ll describe later. What you use does not matter, the code works either way, but you’ll see why the button is helpful. Remove the ‘troublesome code’ from the drop handler. The next part is easy and relatively attractive for me because I only accept one item at a time, but if you have MANY items, you’ll probably want to find another way. I set up a visible text field in the window that displays the list of files that were dropped. In my case, I just get the first item and ignore any extras, but this method will save a list too. In your on drop handler, retrieve the files list, and then set the list to the contents the text field…
on drop theObject drag info dragInfo
set dataTypes to types of pasteboard of dragInfo
if "file names" is in dataTypes then
set preferred type of pasteboard of dragInfo to "file names"
set thePaths to contents of pasteboard of dragInfo
-- For just the first file
set thePath to (item 1 of thePaths)
set theFile to thePath as POSIX file
set preferred type of pasteboard of dragInfo to ""
set contents of text field "text" of window "test" to theFile as string
-- OR --
-- For the whole list (Untested, but should be something like this)
-- set contents of text field "text" of window "test" to thePaths as list
end if
end drop
If you’re using a huge list, you may want to make the text field invisible and stick it off to the side somewhere.
Now you’ll need a button to trigger the ‘troublesome code’, and this is where using the button for the drop zone really shines. Place the ‘troublesome code’ in an on clicked handler, and point your drop zone button at it. After you drop the files, you’ll just need to click…one easy little extra step.
on clicked theObject
if name of theObject is "dropButton" then
set theFile to ((contents of text field "text" of window "test") as string) as file specification
tell application "Finder"
set file type of theFile to "TEXT"
set creator type of theFile to "TEST"
end tell
end if
end clicked
As you can see, I am changing the file codes to the ones I want. You can replace the “tell finder” statement with whatever code you’d like…‘troublesome’ or not. Set a variable to the contents of the text field we created, and then have your way with the value of that variable. If your using a list of files, you’ll need to adjust the “set theFile…” line to extract the list rather than a string. Assuming your code is good, when you click the button the code is executed with no problems, errors, or twirling rainbows. :lol:
Some other thoughts…
If you’re not using the button, you’ll have to set up one, perhaps just off to the side. You could also use a menu/popup button, a checkbox, etc…anything that can receive a click or similar change of state. I would recommend alerting the user somehow that the drop was only the first step, and that they need to click something to finish the process. Whether you enable/make visible a button, change an image or text field value, etc, you should make it clear that just dropping does not do the whole job.
I have been trying to find a way to get the code in the on clicked handler to execute automatically, but any reference I can think of that is made to it from inside the on drop handler waits until it is executed before exiting the drop handler, which just puts us back where we started. If anyone can suggest a solid method of calling a second handler without waiting for a return before exiting the current handler, it would probably solve this problem for us.
Hope this makes sens and helps you too…
j