I wrote a script a couple years back that performed a similar operation at the end of another process. I can try to dig it up if you need but my guess is chatgpt can spit out the same thing. Store psds orig location as a variable and refer