Append file extensions

Hi
I have several hundred files that do not have the extension. I’m sure they don’t have it, instead of being hidden. I tried to use AppleScript. I knew it is simple but I can’t get it working.
A cut-down of the script is


on open finderitems
	repeat with finderitem in finderitems
		set newname to (((path to finderitem) as text) & ".avi")
		display dialog newname
	end repeat
end open

But it gave out error "Can’t make alias into type constant

Thanks in advance

Model: Mac mini 2nd generation
Browser: Safari 4
Operating System: Mac OS X (10.6)

Hi,

path to is a special command of Standard Addtions which specifies the path to special folders or to applications. The second problem is, that only the Finder or System Events can name a file


on open finderitems
	repeat with finderitem in finderitems
		set newname to name of (info for finderitem) & ".avi"
		tell application "Finder" to set name of (contents of finderitem) to newname
		display dialog newname
	end repeat
end open