
The script runs fine when ran from the command-line with the image file set as the argument. When forcing the rules to run from Hazel, nothing appears to happen, but upon checking the Console there do appear to be errors.

- Code: Select all
fn=$1
pixh=$(sips -g pixelHeight $fn)
pixw=$(sips -g pixelWidth $fn)
declare -i pixhval=$(echo ${pixh} | awk -F: ' { print $2 }')
declare -i pixwval=$(echo ${pixw} | awk -F: ' { print $2 }')
if [ $pixhval -gt $pixwval ]; then echo 'mobile'; exit 0; else echo 'desktop'; exit 1; fi
Any assistance would be much appreciated.