I have just finished building an Applescript Application with Xcode and I'm ready for exporting the whole thing.

As this app is not made for the App Store, but private distribution, I have followed this guide to export the .app to my mac.

Upon looking at the resources folder (Application.app/Contents/Resources) I am able to see the AppDelegate.scpt file containing the source code for this application.

This is my first application that I am exporting and my question is:
1. How do I hide/remove or garble the source code so that an ordinary user would not be able to see its contents?
2. What is the conventional way that everyday programmers export their application without revealing the source code (Xcode specific)?

Please help me understand so that I can deploy the app. Thanks in advance.

1 Answer 1


When you save the AppleScript file you have the option of checking "Run Only" - in that case the script is compiled into a new form that can be run exactly as the original script, but it is not meant for further editing/development.

It doesn't mean that the run-only file is complete protected or non-readable, but parts of your code, comments, etc. are not included or not easily readable.

If you want to do more you'll need a code obfuscator if you still want to use AppleScript - however I'm not sure if one exists on the market, or you need to develop your own.

Regarding the second part of your question - most programmers do not use AppleScript. For other languages such as Objective-C, C, C++, etc. the problem is not the same as their programs are ordinarily compiled before they can run, and in the process of compilation they are translated into a non-human readable form.

Some implementations of languages do not exhibit this behaviour - for example ordinary PHP scripts are interpreted or compiled at run-time. For PHP, Javascript, etc. you can buy obfuscators that helps "masking" or "hiding" the original source code while allowing the program to run.

  • That's only true when exported with Script Editor, right? I am using an Xcode AppleScript Application and do not get that option on export.
    – ProGrammer
    Commented Nov 13, 2016 at 22:18
  • Yes, but can't you just open the file in Script Editor and save it from there?
    – jksoegaard
    Commented Nov 13, 2016 at 22:24
  • Magic! It seems to work, hadn't thought about doing it that way. I'll do a few tests before marking it as an answer. Thanks again.
    – ProGrammer
    Commented Nov 13, 2016 at 22:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .