Hide the source code for an Automator quick action / service

Solution 1:

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.

Solution 2:

Generally, Automator workflow (and even applications) are designed to be opened and edited.

And a workflow has to be read to be executed. You may be able to obscure the text in some way to prevent casual inspection.

There may be other ideas here:

https://stackoverflow.com/questions/15757357/i-want-a-shell-script-to-be-executable-but-not-readable