#!/bin/sh
#
#  skipper.sh, a bash script by duus made on Tue Aug  7 19:10:13 EDT 2007 
#  lives in: ~/Documents/Software/unixscripts//itunes/skipper.sh 
#  run binedit skipper to edit.  see binedit help for more information
#
_SCRIPT_NAME=skipper             
_SCRIPT_LOCATION=~/bin/ 
_song_delay=3            
#             
#v skipper by duus, v 1.0, an itunes song skipper
#v ~/Documents/Software/unixscripts//itunes/skipper.sh
#v
#h skipper
#h  usage:  skipper (secs to play each track) (number of skips)
if [ "$1" = "h" -o "$1" = "help" -o "$1" = "v" -o "$1" = "version" ]
	then
#h    <(h)elp>,<(v)ersion> displays this help file 
	if [ "$1" = "v" -o "$1" = "version" ]
		then 
		_search=v
		else
		_search=h
	fi
	grep "^#${_search}" ${_SCRIPT_LOCATION}/${_SCRIPT_NAME} | more
	exit 1
fi
_timetoplay=$1
_skips=$2
_counter=`expr ${_timetoplay} / 3`
echo "skip across ${_skips} for ${_timetoplay} secs each.   (counter ${_counter}.)"
_i=0
while [ ${_i} -lt ${_skips} ]
	do

	runlater count $_timetoplay ${_counter} itunes next
	runlater ${_song_delay} itunes song &
	_i=`expr $_i + 1`
done
 
# -------------------------- 
# 
# end skipper, ~/Documents/Software/unixscripts//itunes/skipper.sh

