Select current layer on all open documents (by layer name)
I need a way to select the same layer on all open documents. For example, I would like to select the layer 'Main' on my active document, run the script and have the 'Main' layer selected on the rest of the documents (so I can tab through them quickly and edit). I always use the same layer names if that helps. 'Main', 'Curves 1', 'Shadow' (folder with mask), and 'Edits'.
I'm currently doing this using actions but it's messy. I used to have a script that could do this but I haven't been able to find it online after endless searching.
(PS 2017)