Corrupted "Script Editor Scripts"

When I use the “Script Editor Scripts” (by the applescript icon, or by Control → Click and then selecting a script, for instance Dialogs → “Dialog 1-button Cancel”, then then original file (in the Library, gets over-written. The next time I try to insert the same Dialog (using that method), I get an error message box:

Applescript Error
An error occurred during the execution of the script.

Cancel Edit

But Edit does not work. I cannot even open the script again via Finder when I go to it, and, as I said, it shows that it has been modified.

Forunately, I have back-up and can restore the file, but a one-time use is less than desirable.

I am using OS X 10.4 .8 or .10 with the same result.

David

Model: Mac mini
AppleScript: 1.10.7 editor (81)
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Hi,

a suggestion: this script checks the stationery pad check box in the information window of all Script Editor Scripts

set SEScriptsFolder to ((path to scripts folder from local domain as Unicode text) & "Script Editor Scripts:")
tell application "Finder" to set stationery of files of entire contents of folder SEScriptsFolder whose kind is "Compiled OSA Script (data-fork)" to true

Mian topic: I ran the scriptlet, but it gave an error. Nevertheless, I looked up info on the stationary check box, and checked one of the offending files. No change in the negative effect. The file was still modiified?

Of other interest: Your script showed, within the (( )) words such as “to” and “from” in bold. I see that as a good thing, but don’t know how to make that happen in Apple’s Script Editor. Can you help with that?

Mostly though, I would like the main topic resolved, if possible.

David

Locking the file, rather than setting it to stationary did seem to help.

Thank you for pointing me in the right direction.

David

However, if I ever “repair permissions” I will loose this.

Does no-one else have this issue of the automatic scripts corrupting?

On my machine it works properly, if I choose the script directly in Script Editor.
Doubleclicking the script in the Finder causes the behavior you described