The effective way to Get File Name without Extension.

I don’t think so. You see a similar thing if you just select the item in the Finder and hit return: with your name, the whole name is selected, rather than all up to the last dot.

I’m guessing the Finder only regards an extension as valid if the system or some app has claimed it and the file therefore has a non-dynamic UTI. But that definition flies in the face of everything else.

It seems to me yet another to the list of reasons not to use Finder scripting where possible.

I think this has to be the answer. I ran System Events on the test file and it did return a “name extension” of 19. So, it appears that Finder is taking some extra step to determine that 19 is not a valid extension.

Here is an option which will return the proper base name, even if the file name has no extension, or ends with a “.”, or has several “.”’s, or ends with a “.19”. It’s pretty quick also

activate
set theFile to choose file

tell application "Finder" to set {theFileName, nameExtension} to {name, name extension} of theFile

if nameExtension ≠ "" then
	set baseName to do shell script "basename -s ." & nameExtension & " " & quoted form of POSIX path of theFile
else
	set baseName to do shell script "basename " & quoted form of POSIX path of theFile
end if