Repair Aliases Mutated Into UNIX Exec files

Hello Keyboard Maestro Hive,

I know this falls ‘neath scripting, which is why I’m self-admitted “KM-Dependent”, but…

In repairing permissions on one of my drives, my aliases (hundreds…thousands?) all were turned into UNIX Exec files.

Apparently, this sh*t happens, and I’ve seen several postings about scripts to repair this, but they – for better or worse – require opening up the bogus UNIX files, and copying the pathname info of the former functional alias (see attached image).

I cannot begin to conceive of writing such a script, and am wondering if anyone has?

I gather it would involve batch renaming the mutant alias/UNIX files…

It makes my head spin just pondering it.

Insights are obviously welcomed.