Applescript to change file extensions
Breaking file paths into file names and file extensions is unneeded when properties exist to access these elements directly, in this case the name extension property. 

set newExt to the text returned of (display dialog "Enter extension:" default answer "Do not include first point")

tell application "Finder"
    set selFiles to selection
    repeat with eachFile in selFiles
        set name extension of eachFile to newExt
    end repeat
end tell