Osx Zip File With Password

  

Press 'Enter/Return'. The files will be compressed and Zipped into a single file. How to Zip Files with Password on Mac. Choose the file you want to Zip and right-click on it (to make it easier, make sure the file is on your desktop). Select 'Compress.' Open up a Finder window. Navigate to your Mac's 'Utilities.' I am using MacBook Pro (Retina 15-Inch Mid 2015).In this tutorial we teach how to Password Protect a Zip File from Mac OS X Command Line. Oct 24, 2016 Double-click the downloaded Zip file in Finder; Drag the extracted Postico.app file to your Applications folder; Find Postico in Launchpad and launch the app. You’ll see a screen that looks like the following (without any database connections configured): Postico. To connect to your local database: Click on ‘New Favorite’. This way only authorized persons who have the password can unzip the encrypted zip file. Password Protect ZIP Files (Windows System Tools). Type the chosen password in the Enter Password area, then re-enter it in the Re-enter password verification field. OSXDaily: Password Protect Zip Files in Mac OS X.


Service to 'Make Protected Zip' files 14 comments Create New Account
Click here to return to the 'Service to 'Make Protected Zip' files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.

You may want to make a slight change to this line:
set passwd to text returned of (display dialog 'password for zipped file' default answer 'password' buttons {'OK', 'Cancel'} default button 'OK')
changing it to:
set passwd to text returned of (display dialog 'password for zipped file' default answer 'password' buttons {'OK', 'Cancel'} default button 'OK' with hidden answer)
The 'with hidden answer' option will bullet out the password that is being entered.

Unfortunately Automator uses its own Dictionary which does not include 'with hidden answer'. To get around this enclose the section in a tell statement: (I also added a quick confirmation since you won't be able to see what you typed ;)

Thanks, chocky & ThomasMyers. Chocky's password modification script grafted into ThomasMyers' original code works perfectly. Excellent set of tips!.

---
-----
Two things in this world aren't overrated: MacOSX and Lemon Meringue Pie.

i would like to use this but the main one input on 10.9 does not work. the comments left me confused since i don't do applescript. thanks, looking forward to using this.

Same issue here - I'd love to see this AppleScript updated for 10.9 compatibility.

I just tested the modified version in Mavericks GM and it works just fine. Here's a complete modified version:

This has been tested on both 10.8.5 and 10.9. You can use the line
set passwd to text returned of (display dialog 'password for zipped file' default answer 'password' buttons {'OK', 'Cancel'} default button 'OK' with hidden answer)
But if you do I recommend you add a 2nd verify password as you can't see what you are typing in. You do not need to use system events. It works just fine. I found that I didn't want to have to enter the password twice.

And, lest I forget, a big THANKS to ThomasMyers (the OP) for an excellent tip. Not only useful in and of itself but it served as a reminder to make more use of Automator and Services.

This is a wonderful hint. Thanks to all who contributed to it.
To further fine tune it, how would I change the default name for the encrypted archive I'm creating to offer the name of the original folder, perhaps with -encrypted appended?

This is a wonderful hint.
How would I change the default name for the encypted archive I making to show the name of the original folder, perhaps with -encrypted appended?

This hint works very well, thanks. I'd like to add this AppleScript to Quickeys instead of as a service through Automater, and I can't get it to work.
I assume that the ApppleScript as configured doesn't see the Finder selection as an input. That is must be happening in Automater.
I'm not very well versed in AppleScript. Anyone know how to make the changes so that this could run as a standalone? I think it's a matter of taking the file or folder that's selected in the Finder and passing that along to the system as the input for the zip file.

Osx Zip File With PasswordI tried out the modified version posted by Chocky with the password hidden and it (mostly) works fine. I did however find a few issues.

1. It includes all the parent hierarchy in the zip file it produces, i.e. if your in /Users/youraccount/Downloads and select a file and make a zip it will contain not only your selection but the parent hierarchy of Users/youraccount/Downloads/ as well. This is because the version written by Chocky (and the original by ThomasMyers) include the -j flag in the command. (Probably related to the following two issues.)

Note: This is contrary to the behaviour of the built-in 'Compress' command provided by Apple in the Finder.

2. If you try to make a zip of a package type file the result when decompressed does not restore a working package.

3. If you try to make a zip of a normal folder it fails completely.

I have fixed all the above issues, the modified version is listed below. Tested only under Mountain Lion so far.

Osx Zip File With Password

I'm having some trouble with this Service as it seems to not like file paths with spaces in them. Is that possible? That's what it seems like, but the 'The action “Run AppleScript” encountered an error.' error message is kind of vague, so it's hard to tell.
That all said, this works great otherwise! Thanks!

Mac Zip File With Password

per you were right. If one of the parent folders of the selected items has a space in the name it failed. I have (hopefully) fixed this in the version below.