#!/bin/sh resume=0 case $1 in -resume) resume=1 ; shift esac if [ $# != 1 ] then echo Syntax: `basename $0` [-resume] directory_to_play exit fi dir=$1 if [ ! -d "$dir" ] then echo Can not find directory: $dir exit fi if [ -d "$dir/VIDEO_TS" ] then dir="$dir/VIDEO_TS" fi case $dir in /*) # OK ;; *) dir=$PWD/$dir ;; esac script=" tell application \"DVD Player\" open VIDEO_TS posix file \"$dir\"" if [ $resume = 0 ] then script="$script set title to 1 set elapsed time to 0" fi script="$script activate set viewer full screen to true set viewer visibility to true set controller visibility to false obscure cursor play dvd end tell" movemouse 600 600 echo "$script" | /usr/bin/osascript