Scripting drag n drop?


I’m trying to make a shell script so people can start the script alone and it will request for a file (with the filepanel command), pass an argument in the command line and it will open the file with the proper command, and also be able to drag and drop the file from the tracker onto the script.
The first 2 parts are working well, but I can’t make the last one work.

It seems while in the Terminal the first argument is $1, for drag and drop it should be @1 (as far as I can see from the xicons program.

if I start my script with:

if [ “@1” != “” ]

it’s correctly understood when something is dropped on the script, but I can’t pass the name of the dropped file into a further command. (with something like GAME="@1")

What could I do?