Repository: svg/svgo-osx-folder-action Branch: master Commit: b53acb7f1b06 Files: 3 Total size: 1.3 KB Directory structure: gitextract_4qlzifos/ ├── README.md ├── install.sh └── svgo.applescript ================================================ FILE CONTENTS ================================================ ================================================ FILE: README.md ================================================ ## OS X Folder Action for SVGO, v0.0.1 1. install [SVGO](https://github.com/svg/svgo) 2. `curl -sS https://raw.githubusercontent.com/svg/svgo-osx-folder-action/master/install.sh | sh` 3. attach Folder Action to some folder: ![screenshot 1](https://raw.github.com/svg/svgo-osx-folder-action/master/screenshots/1.png) ![screenshot 2](https://raw.github.com/svg/svgo-osx-folder-action/master/screenshots/2.png) 4. drag-n-drop `.svg`-files to this folder 5. hurray, your files are optimized! ![](//mc.yandex.ru/watch/18561160) ================================================ FILE: install.sh ================================================ #!/bin/sh SCRIPTS_PATH="$HOME/Library/Scripts/Folder Action Scripts" mkdir -p "$SCRIPTS_PATH" curl -sSO https://raw.githubusercontent.com/svg/svgo-osx-folder-action/master/svgo.applescript osacompile -o "$SCRIPTS_PATH/svgo.scpt" svgo.applescript rm svgo.applescript ================================================ FILE: svgo.applescript ================================================ on adding folder items to this_folder after receiving these_items repeat with i from 1 to number of items in these_items set this_item to item i of these_items set the file_path to the POSIX path of this_item try do shell script "/bin/bash -l -c 'svgo \"" & file_path & "\"'" on error errStr number errorNumber display dialog "Error: " & errStr buttons {"OK"} with icon stop return number end try end repeat end adding folder items to