Hi Phil,
thanks so much!
Tried your code and it is working for these filenames:
1977 Grandpa at the sea.jpg
1981-07 Holiday in greece.jpg
1984-12-24 Christmas with family.jpgFound it's not working if filenames are:
1977 Grandpa at the sea 10.jpg
1977 Grandpa at the sea 11.jpgor
1981-07 Holiday in greece 01.jpg
1981-07 Holiday in greece 02.jpg
1981-07 Holiday in greece 03.jpgThen it will add the file numbering to the exif date, e.g.:
03.07.1981 (greece) or 01.
11.1977 (grandpa)
Your explanation helped me to create a variation with your OR statements and my old code which avoids file numbering beeing added to the exif date.
exiftool '-alldates<${filename;/(\d{4}).(\d{2}).(\d{2})/ ? $_=qq($1:$2:$3 00:00:00) : undef or /(\d{4}).(\d{2})/ ? $_=qq($1:$2:01 00:00:00) : undef or /(\d{4})/ ? $_=qq($1:01:01 00:00:00) : undef}' -r -overwrite_original -if '(not $dateTimeOriginal)' DIR
(Working in OSX, use " instead of ' for Windows)
Added an if-statement to ignore all photos, which already contain exif-date, to avoid overwriting exif-tags and only aim at jpgs without exif-information.
It also skips files, which are missing numbers at the beginning, like
P0003789.jpg.

So i'm very happy now to have a working solution for my scanned paper-photos and having many jpg's batch exified now!
The only problem i didn't catch is:If the filename is
"19840408 Birthdayparty 03.jpg" instead of
"1984-04-08 Birthdayparty 03.jpg" i get very weird dates set in exif-information, like 1984.
40.8.

I had to remove the wrong exif data with:
exiftool -all= -overwrite_original -r DIR
To make it perfect, there must be a way to add another IF-statement to only attack files without a number in 5th filename-position from beginning, or rename files manually.
Thank you,PAPPL