When I export as run-only app the export includes an *.applescript file. It’s not possible to compile that file. First thought I only need to remove the strange characters at the top,
but that didn’t let me compile. Also noticed that umlauts are broken.
There are two issues here. First, Script Debugger does not modify .applescript files in bundles in any way – it just moves or copies them.
The second issue is that your screenshot suggests the file was saved with a UTF-8 BOM, which it should not have.
So the problem stems from whatever application or process is producing the .applescript file in the first place. That is why I as where the file came from. What app was it originally saved from?
It’s an old script but pretty sure it was written in Script Debugger (as I don’t use Script Editor). It was in a git repo but that shouldn’t make a difference, I think.
What I don’t understand is: I can open the original applescript file in Script Debugger. I can compile it. But after exporting as run-only app the newly created applescript file won’t compile. No idea of those things but it looks like it has something to do with Script Debugger’s export.