This won't flatten any TIFFs, but it should quickly separate the flat ones from the layered ones.
If you're using a Mac, copy and paste the following into a blank TextEdit document that is "plain text" not "rich text" (changeable in the Format menu). Save it with a filename ending in ".command" so Finder will execute it with Terminal.app. You'll probably have to do a "chmod +x" on the file in Terminal to make it executable, unless you save it to a mounted network volume and move it back to your computer (that often causes the executable permission to be set).
Place the file in a directory containing TIFF files to be checked, then double-click or CMD-down to run it. It should scan each file in that directory (but not subdirectories - that behavior can be changed if desired).
If a file is a TIFF file containing Photoshop's layer tag, it will move it into a subdirectory named "MULTIPLE LAYERS," which it will create. It will scan all regular files, which should happen fairly quickly, but you can speed it up a bit by setting TIFFEXTENSIONONLY=1, which will only scan files ending in .tiff or .tiff (case insensitive). The only TIFF files it should not move are ones that Photoshop will show as having a single "BACKGROUND" layer.
If there is a single non-background layer that happens to be completely opaque, which is effectively flat, it should still move it. If you consider that a false positive, you'd have to open the file and "flatten" it to make it behave as intended.
here it is:
#!/bin/bash
TIFFEXTENSIONONLY=0
cd "$(dirname "${BASH_SOURCE[0]}")"
SAVEIFS=$IFS
IFS=$(/bin/echo -n $'\n\b')
if [[ TIFFEXTENSIONONLY -eq 0 ]]; then
for N in $(find . -maxdepth 1 -type f ! -name '._*'); do
if [[ $(head -c 2 "$N") == II ]] || [[ $(head -c 2 "$N") == MM ]]; then
tiffutil -dump "$N" | grep '^37724 (0x935c)' > /dev/null
if [[ $? -eq 0 ]]; then
mkdir -p 'MULTIPLE LAYERS'
mv -n "$N" 'MULTIPLE LAYERS'
fi
fi
done
else
for N in $(find -E . -maxdepth 1 -iregex '.*tif(f){0,1}' ! -name '._*'); do
if [[ $(head -c 2 "$N") == II ]] || [[ $(head -c 2 "$N") == MM ]]; then
tiffutil -dump "$N" | grep '^37724 (0x935c)' > /dev/null
if [[ $? -eq 0 ]]; then
mkdir -p 'MULTIPLE LAYERS'
mv -n "$N" 'MULTIPLE LAYERS'
fi
fi
done
fi
IFS=$SAVEIFS
echo TIFF layer checking finished $(date)