diff options
Diffstat (limited to 'bin/page')
-rwxr-xr-x | bin/page | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/bin/page b/bin/page new file mode 100755 index 00000000..28997607 --- /dev/null +++ b/bin/page @@ -0,0 +1,53 @@ +#!/bin/sh + +preview() +{ + list="" + pwd=`pwd` + for i in "$@" + do + if [ -n "$list" ] + then + list="$list, " + fi + n=`cleanname -d $pwd $i | sed 's!/!:!g'` + list="$list\"$n\"" + done + # echo run $list + echo 'tell application "Preview" + activate + open {'"$list"'} + end tell' | osascript +} + +case $# in +0) + cat >/var/tmp/page.$$.tmp + *="/var/tmp/page.$$.tmp" + ;; +*) + ;; +esac + +case `uname` in +Darwin) + preview "$@" + ;; +*) + case "`file $1`" in + *PDF*) + psv $1 + ;; + *PS*) + psv $1 + ;; + *PostScript*) + psv $1 + ;; + *) + qiv "$@" + ;; + esac + ;; +esac + |