Every time I change git branches, Script Debugger reports every .scptd file as corrupted

Every time I change git branches, when I open any .scptd file on the branch I switched to in Script Debugger, I get the error dialog:

Cannot Open Script
The script “Run Export Production Files.scptd” failed to open because Mac OS error -1751.

Because this script was saved with Script Debugger, it may be possible to recover its source code.

The recovered source information may be out of date or damaged. Would you like to proceed with the recovery?

It offers a “Recover” button, which always recovers the full, accurate code. But after using the “Recover” button, trying to create a new document in Script Debugger yields the error:

The operation couldn’t be completed. (OSStatus error -1702.)

Every time, I have to click “Recover,” select all, copy, quit Script Debugger, relaunch Script Debugger, make a new document, select all, paste, and then save it over the old copy. And I have to repeat that process with each script in the .scptd format on the branch.

I have no idea what’s changing… I can do nothing but switch to another branch and switch back, which theoretically leaves everything on the branch identical, yet every .scptd is now corrupted.

Trying to open the same scripts that trigger the “Corrupted” dialog in Script Editor, many of them open fine, Script Editor does not also think they’re corrupted. But I have hit some that Script Editor also thinks are corrupted.

I’ve put one of the corrupted scripts here in case it helps to take a look at it.

Separately, I’m going to take a look at Doeke Zanstra’s osagitfilter.



It opens fine here.

That error is a bit odd, because opening that file just reads the main.rtf file, so there shouldn’t be opportunity for an OSA-related error.

Is anything else, like DropBox, involved here?

No, the git repository is stored locally in my ~/Documents folder, no Dropbox or anything else that should touch the files involved.

Very strange. If you have another file, zip it and email it to me.