Problem with script ending

I am new at Applescript and I’m hoping someone out ther can help me with my script. Here it is.
set user_stuff to display dialog “StudioBoss Login” default answer “Production” buttons {“Cancel”, “Enter”} default button “Enter”
set button_name to button returned of user_stuff
if button_name is “Production” then tell application “Finder”
move (every file of folder “Applications:StudioBoss:License 1:Filemaker Pro 7:”) to folder “Applications:Filemaker Pro 7:” with replacing
if button_name is “leclercr” then tell application “Finder”
move (every file of folder “Applications:StudioBoss:License 2:Filemaker Pro 7:”) to folder “Applications:Filemaker Pro 7:” with replacing
if button_name is “michauds” then tell application “Finder”
move (every file of folder “Applications:StudioBoss:License 3:Filemaker Pro 7:”) to folder “Applications:Filemaker Pro 7:” with replacing
if button_name is “poulinm” then tell application “Finder”
move (every file of folder “Applications:StudioBoss:License 4:Filemaker Pro 7:”) to folder “Applications:Filemaker Pro 7:” with replacing
if button_name is “legerm” then tell application “Finder”
move (every file of folder “Applications:StudioBoss:License 5:Filemaker Pro 7:”) to folder “Applications:Filemaker Pro 7:” with replacing
if button_name is “lefebvrer” then tell application “Finder”
move (every file of folder “Applications:StudioBoss:License 1:Filemaker Pro 7:”) to folder “Applications:Filemaker Pro 7:” with replacing
end tell
tell application “FileMaker Pro”
activate
get remote URL “FMP5://172.25.141.4/StudioBoss.sb6”
end tell
When I try to save it I get "Expected “end of line, etc.” but found “end of script”.
Can anyone help?

You’ve started lots of ‘if … then tell application “Finder”’ blocks that need to be ended with ‘end tell’ lines. I’d guess from the nature of your tests that these lines should be inserted after the ‘move’ lines.

But it would be better to change every ‘if’ except the first one to ‘else if’. That way, you have one ‘if’ block and the tests stop as soon as you hit the right name. It would also be more convenient here to put the ‘if’ block inside one ‘tell application “Finder”’ block, rather than having lots of individual ‘tells’.

Finally, in the kind of ‘display dialog’ where the user has to enter text, you need the ‘text returned’ to access the text. The ‘button returned’ tells you what button was pressed.

set user_stuff to display dialog "StudioBoss Login" default answer "Production" buttons {"Cancel", "Enter"} default button "Enter"
set login_name to text returned of user_stuff

tell application "Finder"
  if login_name is "Production" then
    move (every file of folder "Applications:StudioBoss:License 1:Filemaker Pro 7:") to folder "Applications:Filemaker Pro 7:" with replacing
  else if login_name is "leclercr" then
    move (every file of folder "Applications:StudioBoss:License 2:Filemaker Pro 7:") to folder "Applications:Filemaker Pro 7:" with replacing
  else if login_name is "michauds" then
    move (every file of folder "Applications:StudioBoss:License 3:Filemaker Pro 7:") to folder "Applications:Filemaker Pro 7:" with replacing
  else if login_name is "poulinm" then
    move (every file of folder "Applications:StudioBoss:License 4:Filemaker Pro 7:") to folder "Applications:Filemaker Pro 7:" with replacing
  else if login_name is "legerm" then
    move (every file of folder "Applications:StudioBoss:License 5:Filemaker Pro 7:") to folder "Applications:Filemaker Pro 7:" with replacing
  else if login_name is "lefebvrer" then
    move (every file of folder "Applications:StudioBoss:License 1:Filemaker Pro 7:") to folder "Applications:Filemaker Pro 7:" with replacing
  end if
end tell

-- Then the FileMaker Pro stuff.

Additionally you should have some kind of fallback for cases where an unexpected name is entered.

It’s not uncommon for users to typo their name. Your script doesn’t account for that and will continue to launch Filemaker Pro even if an invalid or unknown value is entered.

You should probably add a ‘catch all’ else statement at the end that fails gracefully, informing the user that their input wasn’t recognized, like:

  if login_name is "Production" then 
    move (every file of folder "Applications:StudioBoss:License 1:Filemaker Pro 7:") to folder "Applications:Filemaker Pro 7:" with replacing 
  else if login_name is "leclercr" then 
    move (every file of folder "Applications:StudioBoss:License 2:Filemaker Pro 7:") to folder "Applications:Filemaker Pro 7:" with replacing 
  else if login_name is "michauds" then 
... etc., etc., etc.
   else 
      display dialog "Sorry, I don't know who you are"
      return
   end if

Thanks for the help but I still can’t get this to work like I want it to. This is what I’m trying to accomplish. I have five copies of FileMaker 7 burned on an image that I boot off of. I wanted one 5 license serial number but FileMaker only does that if I buy another 5 copies (for a total of ten) that I don’t need. So I installed all five copies in different folders. I want to be able to launch a certain FileMaker (License 1 for example) when the user enters a name. The problem with the script the way it is is that it sees FileMaker already open. That means the script only works the first time. Is there a command in Applescript to tell the mac “Hey go to this path and launch this file here when I login as leclercr”?

So surely the solution is to put:

tell application "Filemaker Pro" to quit

at the beginning of your script, no?