Help-Telling the difference between file and folder

So, I have a script that I (with the help of a person on here) wrote a while back that simply just added the .mov extension to a file if it wasn’t there and set the visibilty of a files extension so it would always be seen in the finder. That has worked great, but that was when only adding files into that folder. Now they want to start adding folders into that folder, and with the way the script is now, its going to add a .mov to the end of the folder name and loop. I was wondering if there is a way in the script that I can write it so that it will be able to tell the difference between a file and folder being dropped, and if it is a folder, then to ignore it. Here is the original script and any help would be greatly appreciated. Thanks.

property the_extension : ".mov"

on adding folder items to this_folder after receiving these_items
	repeat with this_item in these_items
		set this_item to this_item as Unicode text
		if this_item does not end with ":" or this_item does not end with the_extension then my process_file(this_item)
		
	end repeat	
end adding folder items to

on process_file(f)
	delay 5
	
	tell application "System Events"
		if f does not end with ".mov" then set name of (f as alias) to (get name of (f as alias)) & the_extension
	end tell
	
	tell application "Finder"
		set the extension hidden of (f as alias) to false
	end tell
end process_file

Try this:

property theExtension : "mov"

on adding folder items to thisFolder after receiving droppedItems
	repeat with thisItem in droppedItems
		try
			get info for thisItem without size
			if (folder of result) is false and (name extension of result) is not equal to theExtension then
				tell application "Finder"
					set thisItem's name to (thisItem's name & "." & theExtension)
					set thisItem's extension hidden to false
				end tell
			end if
		on error errorMsg number errorNum
			display dialog "Error (" & errorNum & "):" & return & return & errorMsg buttons "OK" default button 1 with icon caution
		end try
	end repeat
end adding folder items to

I have a script that does something similar. It picks all of the TIFF files out of a folder. You will have to adapt it to what you are doing but it might give you a start:

tell application "System Events"
	set these_files to every file in folder this_folder whose name does not start with "." and (file type is "TIFF" or name extension is "tiff" or name extension is "tif")
end tell

repeat with i from 1 to the count of these_files
	set this_file to (item i of these_files as alias)
	set filePath to this_file as string
end repeat

Thanks to both of you for your quick responses. I love this community. Thank you.

I’m not entirely sure of the aim here, Christopher - but it might be worth considering what happens if somebody should drop the wrong type of file into the target folder, too. If you intended the “mov” name extension to be added only to files without an extension, then you could try something like this instead (uses Finder for the entire operation):

on adding folder items to this_folder after receiving these_items
	tell application "Finder" to repeat with i in these_items
		if item i's class is not folder and (count (get i's name extension)) is 0 then set i's name to i's name & ".mov"
		set i's extension hidden to false
	end repeat
end adding folder items to