MACRO: Zip Multiple Files in Batches [Example]

Continuing the discussion from For Each Finder Selection Compress to Individual Archive?:

In response to this request, here is the macro I posted in the above thread.


MACRO:   Zipping Multiplle Files in Batches [Example]


#### DOWNLOAD:
<a class="attachment" href="/uploads/default/original/3X/6/8/68ad3b2ab6290516502c1274e9e1521a37bcf339.kmmacros">Zipping Multiplle Files in Batches [Example].kmmacros</a> (21 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

**As always, feel free to post any questions, comments, issues, and/or suggestion you might have concerning this macro.**

---

### Example Output

![image|569x362](upload://wn8FCTu4g8ueRghi5CrPrF8rJol.png) 

---


### ReleaseNotes

Author.@JMichaelTX 

**PURPOSE:**

* **Zip Files of Selected Extensions in Batches**
   * You can limit the number of files per zip file.
   * Zip file uses date/time to ensure uniqueness
   * Output Subfolder will be created if necessary

**HOW TO USE**

1. First, make sure you have followed instructions in the _Macro Setup_ below.
2. Select one or more files in Finder
3. Trigger this macro.

**MACRO SETUP**

* **Carefully review the Release Notes and the Macro Actions**
  * Make sure you understand what the Macro will do.  
  * You are responsible for running the Macro, not me.  ??
.
1. Assign a Trigger to this maro.
2. Move this macro to a Macro Group that is only Active when you need this Macro.
3. ENABLE this Macro.
.
* **REVIEW/CHANGE THE FOLLOWING MACRO ACTIONS:**
(all shown in the magenta color)
   * Set Variable “Local__OutputSubFolder”
   * Set Variable “Local__NumFilesPerZip” 
   * Set Variable “Local__ZipRootName”
   * IF:  File Does NOT have an Image Extension;
     * Set the file extensions to be allowed

**REQUIRES:**

1. **KM 8.2+**
2. **macOS 10.11.6 (El Capitan)**

TAGS:  @Zip @Compress @ShellScript @Finder

USER SETTINGS:

* Any Action in _magenta color_ is designed to be changed by end-user

ACTION COLOR CODES

* To facilitate the reading, customizing, and maintenance of this macro,
      key Actions are colored as follows:
* GREEN   -- Key Comments designed to highlight main sections of macro
* MAGENTA -- Actions designed to be customized by user
* YELLOW  -- Primary Actions (usually the main purpose of the macro)
* ORANGE  -- Actions that permanently destroy Variables or Clipboards,
OR IF/THEN and PAUSE Actions


**==USE AT YOUR OWN RISK==**

* While I have given this a modest amout of testing, and to the best of my knowledge will do no harm, I cannot guarantee it.
* If you have any doubts or questions:
  * **Ask first**
  * Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.

---

![image|572x2000](upload://quQqYA3JBha0WPFL435YfecVTcl.png)
1 Like