Hi Jerome,
Let me see if I can help now that I know a bit more about how the script is needing to be implemented. Here's a revision of your edited version of my script that works on my computer. I added a repeat loop just in case you want to drop multiple files onto it. I'm not sure how to script the Finder to move files and rename them (I'm much more comfortable using a quick "do shell script" command). This script should do the trick now:
on open theseItems
set DestFolder to choose folder
repeat with anItem in theseItems
set File2Move to anItem as alias
set FileInfo to info for File2Move
set FileFullName to name of FileInfo
set FileDest to DestFolder & FileFullName as string
try
FileDest as alias
set fileExt to name extension of FileInfo
set FileName to text 1 through -((length of fileExt) + 2) of FileFullName
set NewFilePath to RenameFile(DestFolder, FileName, fileExt)
on error
set NewFilePath to FileDest
end try
do shell script "mv " & quoted form of POSIX path of File2Move & space & ¬
quoted form of POSIX path of NewFilePath
end repeat
end open
on RenameFile(ParentFolder, FileName, fileExt)
set x to 1
repeat
set NewFilePath to ParentFolder & FileName & x & "." & fileExt as string
try
NewFilePath as alias
set x to x + 1
on error
exit repeat
end try
end repeat
return NewFilePath
end RenameFile
Just change the "set DestFolder to choose folder" part of the script to set the variable DestFolder to the actual path to your destination folder.
Let me know if you get stuck again...