If the dialog stop your work flow, there is a woraround with the following command in AppleScript:
ignoring application responses
make new path item with properties {entire path:PathDetails, name:"Path Name", kind:normal}
tell application "System Events" to tell button "OK" of window 1 of process appName to click
end ignoring
Where the "appName" is either "Adobe Photoshop 2021" or "Adobe Photoshop 2022"
This should teporarily unblock you from using your script. Thanks.