MacOS – Hide the source code for an Automator quick action / service

applescriptautomatormacosservices

I have created an Automator quick action. The quick action listens for highlighted text on any application and runs some shell script based on the highlighted text.
The quick action can be triggered by:

  • selecting text on any application
  • right click Services
  • click on name of the Quick Action

The quick action or service works fine

However, I would like to disable everyone from reading the source code of this quick action. For eg. if I install this quick action on another person's MAC, the person can go to the Library folder and view the source code of this "quick action". I would like the source code to be private.

Is there any way I can achieve this?

Note that the "quick action" should still work as it is without anyone looking at the source code of the quick action.

Best Answer

Yeah, no. When you deliver an interpreted script, people always get to see the code - by design. This is the same for workflows and Automator and shortcuts as it is for perl and bash and python.

Unless and until there is a compiler to convert your source code into machine language and then strip the source names (or obfuscate and tokenize them) even compiled code often comes with source code to aid in debugging.

This is one of the most powerful aspects of scripts that people can see them and know what they do. This enables security validation, “fitness for purpose” checks and easy iteration / comprehension / debugging / adaptation. If you don’t want people to check your work a compiled program allows that on a technical level (or at least requires more work to analyze a binary).

Transparency is baked into this tool chain so you might need another setup if your needs dictate privacy of the code.