Last active
September 9, 2016 12:10
-
-
Save caro3801/848cb6c80073775e32ea14afce46df3b to your computer and use it in GitHub Desktop.
OS X Automator shell script to convert image to eps (LaTeX FTW)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #convert tool to download http://www.imagemagick.org/script/convert.php | |
| #Step 1 : In automator > New folder action : select the folder to watch | |
| #Step 2 (only for testing) : Add "Get elements from the folder indicated" -> select few images from different origins | |
| #Step 3 : Add a shell script with the following code | |
| for f in "$@" | |
| do | |
| filename=$(basename "$f") | |
| base="${filename%.*}" | |
| newbase="${base//[^A-Za-z0-9_-]}" | |
| dest= "${/absolute/path/to/my/eps/folder} | |
| "/usr/local/bin/convert" "$f" "$dest/$newbase.eps" | |
| done | |
| #improvements: add a condition to check the file format you want to convert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment