1

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.

  • 1
    This should be relatively easy to make with Automator, and is a perfect use for the program! Did you try it? Where did you get stuck? I'm happy to help, but I don't have the energy to fully put it together for you. – Wowfunhappy Jan 26 at 2:33
  • Thank you @Wowfunhappy. I don't know how to run the script and how to may it generic or each file/folder. – UmAnusorn Jan 26 at 3:10
  • Consider having a check on your password - ie asking twice for it before use - mis-typing it on a one-shot script means you cannot open the file... Check how excel asks for the password twice when enabling protection... – Solar Mike Jan 26 at 5:33
1

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.

Screenshot

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.

  • Thank you for you answer. Can you show me some example of $1? I think we need file path and password. I have no idea how to get file/folder path. – UmAnusorn Jan 26 at 12:34

You must log in to answer this question.

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