create a doclist in Xcode with drop command

I’m trying to create an mini app the when images are dropped on the interface. it will open it in a choosen app.
I’ve gotten it to work with just applescript
on open (doclist)
set image1 to (item1 of doclist) as alais
end open

the same structure doesn’t work in Xcode using applescript.
on drop TheObject on drag draginfo
the doclist command errors out.

Has any one had any luck with creating a doclist, then passing the info to other commands in the script
(I’m also trying to figure out how to get the files location. experimenting with a path command)
thanks for any help:)

When you create your project, you need to choose the AppleScript Droplet template instead of AppleScript Application. Search your documents for droplet.

gl,