Script help - Incorrect material node connection

I keep getting the following error apparently because I have a node incorrectly connected…

Cycles shader graph connect: can only connect closure to closure (Transparent BSDF.BSDF to Mix Shader.Fac)

The file is large and has over 200 materials making it an enormous task to find the offender, so I tried pasting a script (from this BA post which seems to be a similar problem to mine) into the “scripting” textbox but get a syntax error in line 5 “unknown location:-1”

I’ve never used scripts before so don’t know if I copied/pasted the script properly or if its from an older version of blender and the scripts needs to be updated for 2.83

I hope someone can either troubleshoot the script I used or suggest another method to find the material node that is throwing up this “connection” error