#!/bin/zsh
# ls -l $*
# exit
osascript \
-e 'on run argv' \
-e 'set p to item 1 of argv' \
-e 'set f to POSIX file p' \
-e 'tell application "Finder"' \
-e 'set al to f as alias' \
-e 'try' \
-e 'set o to original item of al' \
-e 'URL of o' \
-e 'on error' \
-e 'URL of al' \
-e 'end try' \
-e 'end tell' \
-e 'end run'  $* | perl -lp -e 's=file://localhost==;' -e 's/\%([0-9A-Fa-f][0-9A-Fa-f])/pack("H*",$1)/eg'
