Get name of Finder window?

Just trying to create a script and I need to check the frontmost window, I can use the window ID, for example if the trash window is front most I expect the name to be Trash or .trash

How can I do this please?

worked it out

tell application "Finder"
	set theName to get the name of the front window
	display dialog theName
end tell

some other help…

tell application "Finder"
	
	set bob to name of window 1
	set fred to name of every window
	
end tell