consistently exit early on errors
extract applescript into another file
refactoring
fixes #1, Escape paths containing spaces
1.0.4