Exporting as run-only app yields *.applescript file that won't compile

,

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,

1

but that didn’t let me compile. Also noticed that umlauts are broken.

What was the source of the .applescript file? It looks like it contains a UTF-8 BOM, which it shouldn’t.

Sorry, I mean where did it come from? How was it saved before it was added to the bundle?

It was an *.applescript file.

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.

Script Debugger never includes a BOM, but a git repository could well.

Anyway, the solution is to re-save it without the BOM.

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.

Would you be able to send me before and after examples?

OK, I misunderstood – I now see the issue, and will fixit in an upcoming build.

For anyone affected, the file is mistakenly being saved in UTF-16 with a BOM – the solution, if you need the file, is to resave it as UTF-8.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.