Skip to content

Instantly share code, notes, and snippets.

@Zodiase
Created August 8, 2016 11:06
Show Gist options
  • Save Zodiase/1117c063c137fd55dab20660d740d6fc to your computer and use it in GitHub Desktop.
Save Zodiase/1117c063c137fd55dab20660d740d6fc to your computer and use it in GitHub Desktop.
Zip Each - Automator Workflow
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key>
<string>419</string>
<key>AMApplicationVersion</key>
<string>2.6</string>
<key>AMDocumentVersion</key>
<string>2</string>
<key>actions</key>
<array>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.cocoa.path</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>1.1.2</string>
<key>AMApplication</key>
<array>
<string>Finder</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>fileNames</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.cocoa.path</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Get Specified Finder Items.action</string>
<key>ActionName</key>
<string>Get Specified Finder Items</string>
<key>ActionParameters</key>
<dict>
<key>fileNames</key>
<array>
<string>~/Desktop/test automator/d</string>
<string>~/Desktop/test automator/c.txt</string>
<string>~/Desktop/test automator/b</string>
<string>~/Desktop/test automator/a</string>
</array>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.SpecifiedFiles</string>
<key>CFBundleVersion</key>
<string>1.1.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryFilesAndFolders</string>
</array>
<key>Class Name</key>
<string>SpecifiedFilesAction</string>
<key>Disabled</key>
<true/>
<key>IgnoresInput</key>
<true/>
<key>InputUUID</key>
<string>0B3AE5C0-7F60-45B3-A736-F7DAA182ACE1</string>
<key>Keywords</key>
<array>
<string>File</string>
<string>Choose</string>
<string>Find</string>
<string>Get</string>
</array>
<key>OutputUUID</key>
<string>FCAA0205-B6A8-4AC6-A89A-D8D55B6AB386</string>
<key>UUID</key>
<string>5F4C2FB5-8A3B-4F65-B532-7DF811EE9B35</string>
<key>UnlocalizedApplications</key>
<array>
<string>Finder</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<array/>
<key>name</key>
<string>fileNames</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<false/>
<key>location</key>
<string>440.500000:112.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Get Specified Finder Items.action/Contents/Resources/English.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<false/>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run AppleScript.action</string>
<key>ActionName</key>
<string>Run AppleScript</string>
<key>ActionNameComment</key>
<string>Pack Input</string>
<key>ActionParameters</key>
<dict>
<key>source</key>
<string>on run {input, parameters}
return {input}
end run</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.RunScript</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunScriptAction</string>
<key>InputUUID</key>
<string>06E56DCC-28E6-460A-9234-E0B13B5DC838</string>
<key>Keywords</key>
<array>
<string>Run</string>
</array>
<key>OutputUUID</key>
<string>3AEFF2E2-9081-46D7-A28B-FCCCAF869721</string>
<key>UUID</key>
<string>9AD2C655-7CB4-45EB-9838-C0C68F1FECBF</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string>on run {input, parameters}
(* Your script goes here *)
return input
end run</string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<false/>
<key>location</key>
<string>440.500000:154.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run AppleScript.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<false/>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<false/>
<key>Types</key>
<array>
<string>*</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>v.1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>variableUUID</key>
<dict>
<key>isPathPopUp</key>
<false/>
<key>selectedVariableUUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
<key>variableUUIDsInMenu</key>
<array/>
</dict>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>*</string>
</array>
</dict>
<key>AMRequiredResources</key>
<array/>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Set Value of Variable.action</string>
<key>ActionName</key>
<string>Set Value of Variable</string>
<key>ActionNameComment</key>
<string>Save Raw Input (Packed)</string>
<key>ActionParameters</key>
<dict>
<key>variableUUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.Set_Value_of_Variable</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<true/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>Set_Value_of_Variable</string>
<key>InputUUID</key>
<string>57AD9ACA-13C2-4B63-A28D-0F9660C046A8</string>
<key>Keywords</key>
<array>
<string>variable</string>
<string>binding</string>
<string>input</string>
<string>output</string>
<string>storage</string>
</array>
<key>OutputUUID</key>
<string>D651CD1E-FC5C-4206-918A-AD26150F4700</string>
<key>UUID</key>
<string>13DF8390-20C9-4332-8BE7-9B22D07AF567</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>variableUUID</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<false/>
<key>location</key>
<string>440.500000:196.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Set Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<false/>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.cocoa.path</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>2.1.1</string>
<key>AMApplication</key>
<array>
<string>Finder</string>
</array>
<key>AMParameterProperties</key>
<dict/>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.cocoa.path</string>
</array>
</dict>
<key>AMRequiredResources</key>
<array/>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Get Selected Finder Items 2.action</string>
<key>ActionName</key>
<string>Get Selected Finder Items</string>
<key>ActionParameters</key>
<dict/>
<key>BundleIdentifier</key>
<string>com.apple.Automator.Get_Selected_Finder_Items_2</string>
<key>CFBundleVersion</key>
<string>2.1.1</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryFilesAndFolders</string>
</array>
<key>Class Name</key>
<string>AMGetSelectedFinderItemsAction</string>
<key>IgnoresInput</key>
<true/>
<key>InputUUID</key>
<string>C127DA85-7BD3-4D29-A5A7-CA1534CDAD26</string>
<key>Keywords</key>
<array/>
<key>OutputUUID</key>
<string>3D628610-1131-4DDC-BE30-1CB9AC1B35FA</string>
<key>UUID</key>
<string>5BD058F0-6D93-4C47-AFDF-DBA555559876</string>
<key>UnlocalizedApplications</key>
<array>
<string>Finder</string>
</array>
<key>arguments</key>
<dict/>
<key>conversionLabel</key>
<integer>0</integer>
</dict>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run AppleScript.action</string>
<key>ActionName</key>
<string>Run AppleScript</string>
<key>ActionNameComment</key>
<string>Pack Input</string>
<key>ActionParameters</key>
<dict>
<key>source</key>
<string>on run {input, parameters}
return {input}
end run</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.RunScript</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunScriptAction</string>
<key>InputUUID</key>
<string>88508ADF-24F7-4A01-A7A1-5247D744A121</string>
<key>Keywords</key>
<array>
<string>Run</string>
</array>
<key>OutputUUID</key>
<string>362111EB-BFAD-4323-AAAE-27C14BBABECD</string>
<key>StartAction</key>
<false/>
<key>UUID</key>
<string>AB8C71CE-CA75-4EE9-B229-66AD86474E37</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string>on run {input, parameters}
(* Your script goes here *)
return input
end run</string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<false/>
<key>location</key>
<string>440.500000:280.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run AppleScript.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<false/>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<false/>
<key>Types</key>
<array>
<string>*</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>v.1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>variableUUID</key>
<dict>
<key>isPathPopUp</key>
<false/>
<key>selectedVariableUUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
<key>variableUUIDsInMenu</key>
<array/>
</dict>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>*</string>
</array>
</dict>
<key>AMRequiredResources</key>
<array/>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Set Value of Variable.action</string>
<key>ActionName</key>
<string>Set Value of Variable</string>
<key>ActionNameComment</key>
<string>Save Selected Input (Packed)</string>
<key>ActionParameters</key>
<dict>
<key>variableUUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.Set_Value_of_Variable</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<true/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>Set_Value_of_Variable</string>
<key>InputUUID</key>
<string>4E467E82-1E59-4D03-8118-E614FC53DC1A</string>
<key>Keywords</key>
<array>
<string>variable</string>
<string>binding</string>
<string>input</string>
<string>output</string>
<string>storage</string>
</array>
<key>OutputUUID</key>
<string>528B056B-3718-4646-B5FD-2AC140D2B96E</string>
<key>UUID</key>
<string>7DF90507-F540-4E6C-843F-731AFD678520</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>variableUUID</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>440.500000:386.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Set Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>*</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>v.1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>variableUUID</key>
<dict>
<key>isPathPopUp</key>
<false/>
<key>selectedVariableUUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
<key>variableUUIDsInMenu</key>
<array/>
</dict>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>*</string>
</array>
</dict>
<key>AMRequiredResources</key>
<array/>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Get Value of Variable.action</string>
<key>ActionName</key>
<string>Get Value of Variable</string>
<key>ActionNameComment</key>
<string>Get Raw Input (Packed)</string>
<key>ActionParameters</key>
<dict>
<key>variableUUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.Get_Value_of_Variable</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>Get_Value_of_Variable</string>
<key>IgnoresInput</key>
<true/>
<key>InputUUID</key>
<string>5CB6F933-F10E-463F-B208-B9A9025DEC82</string>
<key>Keywords</key>
<array>
<string>variable</string>
<string>binding</string>
<string>input</string>
<string>output</string>
<string>storage</string>
</array>
<key>OutputUUID</key>
<string>5C589A94-5140-456E-840F-AE8F87A8D8DD</string>
<key>UUID</key>
<string>E13AE43D-3987-4C9B-8C21-45D760635BA7</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>variableUUID</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<false/>
<key>location</key>
<string>440.500000:428.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Get Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<false/>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>*</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>v.1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>variableUUID</key>
<dict>
<key>isPathPopUp</key>
<false/>
<key>selectedVariableUUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
<key>variableUUIDsInMenu</key>
<array/>
</dict>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>AMRequiredResources</key>
<array/>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Get Value of Variable.action</string>
<key>ActionName</key>
<string>Get Value of Variable</string>
<key>ActionNameComment</key>
<string>Get Selected Input (Packed)</string>
<key>ActionParameters</key>
<dict>
<key>variableUUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.Get_Value_of_Variable</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>Get_Value_of_Variable</string>
<key>InputUUID</key>
<string>58C82D86-391B-4C24-856B-F41A6B77CCD5</string>
<key>Keywords</key>
<array>
<string>variable</string>
<string>binding</string>
<string>input</string>
<string>output</string>
<string>storage</string>
</array>
<key>OutputUUID</key>
<string>FA4E2648-8390-44F4-BF8B-DD99A482F43C</string>
<key>StartAction</key>
<false/>
<key>UUID</key>
<string>3D873531-7F1E-4991-AB22-E3825070A17E</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>variableUUID</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<false/>
<key>location</key>
<string>440.500000:470.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Get Value of Variable.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<false/>
</dict>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>1.0.2</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.applescript.object</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run AppleScript.action</string>
<key>ActionName</key>
<string>Run AppleScript</string>
<key>ActionParameters</key>
<dict>
<key>source</key>
<string>on run {input, parameters}
set rawInput to item 1 of input
set selectedInput to item 2 of input
set selectedAliases to {}
if rawInput is not {} then
set selectedAliases to rawInput
else if selectedInput is not {} then
set selectedAliases to selectedInput
else
display notification "Nothing to archive." with title "Archive Each"
return input
end if
set archives to archiveAliasList(selectedAliases)
tell application "Finder" to reveal archives
set archiveCount to count of archives
if archiveCount &gt; 1 then
set message to archiveCount &amp; " files archived." as string
else
set message to archiveCount &amp; " file archived." as string
end if
display notification message with title "Archive Each"
return archives
end run
on archiveAliasList(aliasList)
set aliasCount to count of aliasList
set zippedFiles to {}
tell application "Finder"
repeat with aliasItem in aliasList
set theFolder to container of aliasItem as alias
set itemPath to quoted form of POSIX path of aliasItem
set filename to name of aliasItem
set folderPath to POSIX path of theFolder
set zipFilePathString to (folderPath &amp; filename &amp; ".zip")
set zipFilePath to quoted form of zipFilePathString
do shell script "zip -r " &amp; zipFilePath &amp; " " &amp; itemPath
set end of zippedFiles to POSIX file zipFilePathString as alias
end repeat
end tell
return zippedFiles
end archiveAliasList</string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.Automator.RunScript</string>
<key>CFBundleVersion</key>
<string>1.0.2</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunScriptAction</string>
<key>InputUUID</key>
<string>97A3AA67-32DF-4413-BCE7-AA88520D7C7F</string>
<key>Keywords</key>
<array>
<string>Run</string>
</array>
<key>OutputUUID</key>
<string>F39D9290-18B6-4B7B-A7AE-A8AD6D0809D5</string>
<key>UUID</key>
<string>E9790394-53B5-40C2-8424-1077A754096C</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<string>on run {input, parameters}
(* Your script goes here *)
return input
end run</string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
</dict>
<key>conversionLabel</key>
<integer>0</integer>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>440.500000:1434.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run AppleScript.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
</dict>
</array>
<key>connectors</key>
<dict>
<key>25B82674-CAB0-40BA-AE15-424079C958CC</key>
<dict>
<key>from</key>
<string>5F4C2FB5-8A3B-4F65-B532-7DF811EE9B35 - 5F4C2FB5-8A3B-4F65-B532-7DF811EE9B35</string>
<key>to</key>
<string>9AD2C655-7CB4-45EB-9838-C0C68F1FECBF - 9AD2C655-7CB4-45EB-9838-C0C68F1FECBF</string>
</dict>
<key>37A27D80-38E2-4E97-ADA9-32FBD53AFC95</key>
<dict>
<key>from</key>
<string>AB8C71CE-CA75-4EE9-B229-66AD86474E37 - AB8C71CE-CA75-4EE9-B229-66AD86474E37</string>
<key>to</key>
<string>7DF90507-F540-4E6C-843F-731AFD678520 - 7DF90507-F540-4E6C-843F-731AFD678520</string>
</dict>
<key>4AD1E85F-7D7F-499A-81DC-83D464CE633F</key>
<dict>
<key>from</key>
<string>5BD058F0-6D93-4C47-AFDF-DBA555559876 - 5BD058F0-6D93-4C47-AFDF-DBA555559876</string>
<key>to</key>
<string>AB8C71CE-CA75-4EE9-B229-66AD86474E37 - AB8C71CE-CA75-4EE9-B229-66AD86474E37</string>
</dict>
<key>57E9ED63-FB36-4841-9AB0-C0AF300603F1</key>
<dict>
<key>from</key>
<string>E13AE43D-3987-4C9B-8C21-45D760635BA7 - E13AE43D-3987-4C9B-8C21-45D760635BA7</string>
<key>to</key>
<string>3D873531-7F1E-4991-AB22-E3825070A17E - 3D873531-7F1E-4991-AB22-E3825070A17E</string>
</dict>
<key>681F4809-84BE-41A5-9E50-08C43AD60C4B</key>
<dict>
<key>from</key>
<string>7DF90507-F540-4E6C-843F-731AFD678520 - 7DF90507-F540-4E6C-843F-731AFD678520</string>
<key>to</key>
<string>E13AE43D-3987-4C9B-8C21-45D760635BA7 - E13AE43D-3987-4C9B-8C21-45D760635BA7</string>
</dict>
<key>73AC888F-2353-4BCC-9F21-3EC337935CBB</key>
<dict>
<key>from</key>
<string>13DF8390-20C9-4332-8BE7-9B22D07AF567 - 13DF8390-20C9-4332-8BE7-9B22D07AF567</string>
<key>to</key>
<string>5BD058F0-6D93-4C47-AFDF-DBA555559876 - 5BD058F0-6D93-4C47-AFDF-DBA555559876</string>
</dict>
<key>851F6C85-A63D-4D87-9F85-A1E40237A3F1</key>
<dict>
<key>from</key>
<string>3D873531-7F1E-4991-AB22-E3825070A17E - 3D873531-7F1E-4991-AB22-E3825070A17E</string>
<key>to</key>
<string>E9790394-53B5-40C2-8424-1077A754096C - E9790394-53B5-40C2-8424-1077A754096C</string>
</dict>
<key>853B4D8A-7277-423B-A7D0-30E11561A48A</key>
<dict>
<key>from</key>
<string>9AD2C655-7CB4-45EB-9838-C0C68F1FECBF - 9AD2C655-7CB4-45EB-9838-C0C68F1FECBF</string>
<key>to</key>
<string>13DF8390-20C9-4332-8BE7-9B22D07AF567 - 13DF8390-20C9-4332-8BE7-9B22D07AF567</string>
</dict>
</dict>
<key>variables</key>
<array>
<dict>
<key>UUID</key>
<string>6C1DB6F6-C4C0-4074-A938-4E2054B2A50D</string>
<key>identifier</key>
<string>com.apple.Automator.Variable.Text</string>
<key>name</key>
<string>raw_input</string>
<key>value</key>
<string></string>
</dict>
<dict>
<key>UUID</key>
<string>BB5AE1AC-E73F-4F97-BF2D-3A366D650DC8</string>
<key>identifier</key>
<string>com.apple.Automator.Variable.Text</string>
<key>name</key>
<string>selected_input</string>
<key>value</key>
<string></string>
</dict>
<dict>
<key>UUID</key>
<string>EBF2CE94-A798-4E56-9B84-E691DED18915</string>
<key>identifier</key>
<string>com.apple.Automator.Variable.Storage</string>
<key>name</key>
<string>Raw Input</string>
</dict>
<dict>
<key>UUID</key>
<string>66A13911-CA1B-4BDA-BD84-16C2A1C3E9C5</string>
<key>identifier</key>
<string>com.apple.Automator.Variable.Storage</string>
<key>name</key>
<string>Selected Input</string>
</dict>
<dict>
<key>UUID</key>
<string>AF9D1176-13E1-4D63-9CE6-A0E014C9AC91</string>
<key>identifier</key>
<string>com.apple.Automator.Variable.Storage</string>
<key>name</key>
<string>Raw Input 1</string>
</dict>
<dict>
<key>UUID</key>
<string>1490D774-3636-4DDF-BDDB-93AEEDF51B12</string>
<key>identifier</key>
<string>com.apple.Automator.Variable.Storage</string>
<key>name</key>
<string>Selected Input 1</string>
</dict>
</array>
<key>workflowMetaData</key>
<dict>
<key>workflowTypeIdentifier</key>
<string>com.apple.Automator.application</string>
</dict>
</dict>
</plist>
@Zodiase
Copy link
Author

Zodiase commented Aug 8, 2016

An Automator Workflow Application created based on this code archives each item in the selection into one zip file.

How to Use

  1. Add the app to the Finder toolbar by dragging and dropping it to the toolbar while holding cmd key.
  2. Run the app with either:
    1. Drag and drop some files onto the app icon in the Finder toolbar.
    2. Select some files in the Finder and click the app icon in the Finder toolbar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment