Create a custom Quick Action to create a zip file with password How to create a custom Quick Action to create a zip file with password.

I understand, to create a zip file with password the following command-line can be used:

zip -er archive.zip /path/to/directory/

or

zip -e archive.zip /path/to/directory/

but, how can it be made simpler in the Quick Action on folder or on any file using Automator?

I don't know how to run a script and how to make it generic for each file/folder.
To make a Service/Quick Action take any file or folder as input, select:


  Service receives selected files or folders in Finder.app


...at the top of the Automator window.



The selected files or folders will get passed as input to the first action in your workflow.

(Note: The workflow will not receive this input when it is run inside Automator! in order to test your your Quick Action by running it inside Automator, you need to temporarily add "Ask for Finder items" as the first action in your Workflow. Delete this action when you are finished building the Workflow.)

Among the many actions you can add is one called "Run Shell Script", which will likely be useful to you. If you change the dropdown to Pass input: as arguments, you'll be able to use the variables $1, $2, $3, etc to reference items passed from previous actions within your script.

After you have finished building your workflow and have saved it, you will be able to right click on any file or folder in Finder, and select your Workflow from the right click menu to run it.