1
2
3
4
5
6
7
8
9
10
APP_PATH=$(ps -xwwp $PPID -o command|grep -o '.*.app')
ORIGIFS="$IFS"
IFS=$'\n\b'
INDEX=0
Y=(top center bottom)
for line in $(</tmp/tm_tidy_errors); do
   CocoaDialog bubble --y-placement "${Y[INDEX]}" --title "Tidy Warning" --text "$line" --icon-file "${APP_PATH}/Contents/Resources/Textmate.icns" &
   INDEX=$(((INDEX+1) % 3))
done
IFS="$ORIGIFS"