Naming FM records correctly

Hi the following script is supposed to create a database record in Filemaker with the filename of the file dropped on the script. That bit works, however, when there are multiple files it creates the correct number of records but they all have the name of the first file - any ideas?
Thanks

on open the_files
repeat with this_file in the_files
set attachment_name to name of (info for (the_files’s item 1))
tell me to activate
tell application “FileMaker Pro”
create record at end of database “test.fp5”
set cell “test” of last record of database “test.fp5” to attachment_name
end tell
end repeat
end open

“the_files” is a list of the dropped files so “the_files’s item 1” is always the first item of that list, the first file. You are iterating through the list with the variable “this_file” that takes on the value of each item in the list of “the_files” as it progresses through the loop so, this is what you want (with a few other, hopefully self-explanatory, tweaks):

on open the_files
    repeat with this_file in the_files
        set attachment_name to name of (info for (this_file as alias))
        tell application "FileMaker Pro"
            set new_record to create record at end of front database
            set cellValue of cell "test" of new_record to attachment_name
        end tell
    end repeat
end open

Jon

Worked perfectly - thanks Jon!!