Thursday, October 28, 2010

focus

I had been running some scripts, but kept getting distracted.

I found a linux script for a dialog alert, but not one for OSX, so here is my modified script for OSX.


#!/bin/bash

eval $@

if [[ $? -eq 0 ]]; then
osascript -e 'tell application "Finder"' -e "activate" -e "display dialog \"Command '$@' in $PWD completed.\"" -e 'end tell';
else
osascript -e 'tell application "Finder"' -e "activate" -e "display dialog \"Command '$@' in $PWD failed! $@\"" -e 'end tell';
fi