Can AppleScript get folder contents with file extension exclusion? Looking for a way in AppleScript to get the contents of a directory with an exclusion to parse through. I know how to do this using find in a for loop with the command:

find . -not -name "*.bat"


but I'm curious to know if there is an AppleScript only approach to getting a folder's contents without the file extension .bat.

I've built a dummy directory on my desktop, added several files and tried:

tell application "Finder"
    set theFiles to get every item of (entire contents of folder (choose folder)) whose kind ≠ ".bat"
    reveal theFiles
end tell


the .bat files are highlighted. Using does not contain compiles but errors out to:

Error:


  Can’t get every item of true.


Code:

tell application "Finder"
    set theFiles to get every item of (entire contents of folder (choose folder) does not contain ".bat")
    reveal theFiles
end tell


Trying another approach I get an error of:

Error:


  Finder got an error: Unknown object type.


Code:

tell application "Finder"
    set theFiles to get every item of (entire contents of folder (choose folder)) whose type ≠ {"public.bat"}
    reveal theFiles
end tell


If I try to modify the approach I can only get a solid result if I narrow down the name of a bat file using:

Code: 

tell application "Finder"
    set theFiles to get (every file of folder (choose folder) whose name is not in {"foobar.bat"})
    reveal theFiles
end tell


In pure AppleScript is there a way to get contents of a directory with an exclusion for file type? I would possibly like to chain the exclusion for multiple file types.
Try this :

tell application "Finder"
    set theFiles to files in folder (choose folder) whose name does not end with ".bat"
    reveal theFiles
end tell