#!/bin/sh

# cranconvertkey09.sh
# Pear Note
#
# Created by Chad Sellers on 2/27/09.
# Copyright 2009 Useful Fruit Software, LLC. All rights reserved.

UNZIP="/usr/bin/unzip"
GREP="/usr/bin/grep"

PREVIEW_FILE="QuickLook/Preview.pdf"

$UNZIP -l "$1" 2> /dev/null | $GREP -q $PREVIEW_FILE
UNZIP_RET=$?
if [ $UNZIP_RET -eq 0 ];
	then $UNZIP -p "$1" $PREVIEW_FILE > "$2";
	exit $?;
fi
exit 1