Skip to content

pilisir/macOSzip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macOS zip service

Do your own easy way to compress files or folders as a clean zip with simple services on macOS Finder.

中文版

Feature

  • Zip files or folders without any .DS_Store and __MACOSX file.
  • Zip files or folders with the full parent path beginning under ~/, known as username, to the ~/Documents folder.

Install

There are two way to create the services.

Way 1: Copy and Paste (If you run into a problem about encoding of workflow file while trying this way, please try Way 2 instead.)
  1. Directly download the latest release and uncompress it.
  2. Move those two service files to the local service folder. You can easily copy ZIP.workflow and ZIP with path.workflow to your local $USER/Library/Services/ directory. (Please set your Finder to be able to see hidden directories via shortcut key [Shift] + [Command] + [.] first.)
  3. Done !
Way 2: Create services yourself.
  1. Open Automator app.
  2. Press [Command] + [N] to new a document which type is Service.
  3. Select Action > Library > Files & Folders > Get Selected Finder Items and drag it to the right side as Step One.
  4. Select Action > Library > Utillities > Run Shell Script and drag it to the right side as Step Two.
  5. Drop down Pass input of Step Two and select the to stdin.
  6. Copy content text of file from this project, ./src/zip.sh, paste it as the Step Two shell content text.
  7. Look up the top, drop down Service recives selected and select files or folders.
  8. Press [Command] + [S] to save this service with specified name "ZIP" (or any custom name yourself).
  9. Done !
  10. To create second Service, ZIP With Path, just repeat Way 2 and change to copy content text from ./src/zip_with_path.sh.

Usage

  1. Select files or folders in Finder, open conetxt menu and select Service > ZIP (or ZIP with path).
  2. That's all ! context menu

Recommend to set Shortcut Key

  • You can assign shortcut key for services via Keyboard in System Preferences to make things more easily.
  • Recommend [Control] + [Command] + [Z], meaning as Zip and [Control] + [Command] + [P], meaning as zip with full parent Path.
  • Tutorial

FYI

  • ZIP with path would ignore path, /Documents, if files or folders are already under ~/Documents.
  • You can custom destination folder of ZIP with path via edit the variable destDir.
  • I never test it lower than High Sierra.
  • You may find out the script not elegant itself, because I never code any shell script before, and I bought my first mac a month ago. I look forward to any suggestion or fork.

License

MIT License

Encourage

About

Do your own easy way to compress files or folders as a clean zip with simple services on macOS Finder.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published