applescript solutions for terminal.app