Save in Catalina fails

Hi all

OSX 10.15.7 (19H15)

I’ve had a Flatten script - initially created by Christopher Stone working for some years.

recently this happens:

SD7 Save error -1728

I can save it manually (from the unsaved file eg untitled2) by selecting the old flats file and replacing over it.

I’m on Catalina and perhaps when I changed up from Mojave this was the cause?

I’ve checked that SD has Full Disk Access in Security & Privacy prefs.

I thought perhaps I need to code sign the files, but it doesn’t appear to be necessary?

I modified the path to the file on CS’s suggestion but outcome identical.

I’ve attached the script fyi. (2.5 MB)

I note that the size of recent scripts is much larger than before, & with a different file icon - is the answer there?