#!/bin/bash # PURPOSE: batch conversion of Skim notes to syncable format of PDF files using Skim's skimnotes command-line tool # AUTHOR: Christiaan Hofman # ASSUMPTIONS: skimnotes is located at /Applications/Skim.app/Contents/SharedSupport/skimnotes # USAGE: # skimsyncable PDFDIR|PDFFILE skimnotes=/Applications/Skim.app/Contents/SharedSupport/skimnotes # To convert back to non-syncable notes, swap the -n and -s options below if [[ -d "$1" ]]; then find "$1" -type f -name "*.pdf" -exec "$0" "{}" ";" elif "$skimnotes" test -n "$1"; then "$skimnotes" convert -s "$1" "$1" fi