fun with applescript
This commit is contained in:
parent
8bead10998
commit
5645c4afff
5 changed files with 242 additions and 6 deletions
53
bin/page
Executable file
53
bin/page
Executable file
|
|
@ -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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue