How to Hide the source code in Xcode?

I am writing an app using AppleScriptObjC in Xcode 7.3.1, and while making the archive I see the source code is still inside the package, is there a way to hide it or transform it completely to binary code? Thanks

Go to Build Settings and search for OSACompile - Build Options. Change Save as Execute-Only to Yes.

Actually I didn’t work :expressionless:

Double-check – it does work.

I did check and changed it in both levels here is screen shots of what I did
https://dl.dropboxusercontent.com/u/6735961/xcode1.png
https://dl.dropboxusercontent.com/u/6735961/xcode2.png

Thank you

Have you done a Product → Clean?

I just did and still same result no change :frowning:

Are you sure you’re looking at the latest build?

You can check what’s happening. In the Navigator panel, click on the last icon, the Report Navigator. Find the latest Build report. You should then see a list of build stages with green ticks. Find the one that compiles your code. Select it, and then click in he icon that appears to its right to expand it. This will show the OSACompile command issued as part of the build process. In it, you should see -x – that means execute-only.

it looks like you described but still the same result, here some screenshots
https://dl.dropboxusercontent.com/u/6735961/xcode3.png
https://dl.dropboxusercontent.com/u/6735961/xcode4.png

Are all of the scripts .applescript files in your project? Are they all readable?

Yes all of them inside my project and they are readable
thank you

Then I’m at a loss. Your screenshot shows the -x parameter in there. If you want to email me the project, I’d be happy to take a look. I don’t know what else to suggest.

I did create small project for test, just a window with a button and also has the same issue

ok I will send it to you now to your email, thank you again Shane for your time

done

Hi Shane,
is Xcode able to hide the script files completely or the only thing it can do is keep the files visible and make them uneditable?
is it also possible to exclude some scripts from beeing compiled? I want to use some files to store data so I could edit them later without the need to recompile the app, they are basically setting files

thank you

It’s a requirement from the AppleScriptObjC.framework that is used. It’s because of the AppleScript files not being compiled into the executable (see:.app/Contents/MacOS/). The first thing that is done after opening the process instance (before launching the application instance) is that the AppleScriptObjC.frameworks tries to load all AppleScript files in the script folder from the application bundle. Because of this workflow the files has to be stored in that particular folder and reachable for the framework.

If they are settings you should store them outside the application in the preferences of application support folder. You could use a default file and when at launch this file is missing you copy this file to the preference of application support folder.

thank you DJ Bazzie Wazzie