I have an Applescript that successfully clicks the Replace button in the InDesign Save As dialog, but the same script doesn't work in Photoshop. It fails on the click command in this section of the script:
tell application "System Events" to tell process activeProcess click button "Replace" of sheet 1 of front window end tell
with this message:
Can't get sheet 1 of window 1 of process "Adobe Photoshop CC 2018": invalid index
Just to be thorough, here's what the Save As dialog looks like when the Replace button is available:
Thanks for your help!