#!/bin/sh -x
#--verbose
scriptname=`basename $0`
if [ $# -ne 1 ]; then
echo "Usage: $scriptname path_to_Odyssey"
exit
fi

if [ ! -d "$1/Contents/Resources/odyssey_html" ]
then
  echo "$1 does not appear to be an Odyssey application"
  exit 1
else
  echo "Making the Odyssey hyperlinks folder..."
  srcPath="$1/Contents/Resources/odyssey_html"
  aliasParent=`dirname "$1"`
/usr/bin/osascript > /dev/null <<EOT
tell application "Finder"
set macSrcPath to POSIX file "$srcPath" as text
set macDestPath to POSIX file "$aliasParent" as text
make new alias file to folder macSrcPath at folder macDestPath with properties{name:"Odyssey Hyperlinks"}
end tell
EOT
echo "Hyperlink folder created!"
fi
