-- copy and paste this to Script Editor -- then export it with file format set to "Application" and check "Run-only" -- save the app to your Applications folder to have it picked up by Spotlight easily tell application "Terminal" set terminal_was_running to (it is running) set window_ids to (id of windows) reopen if not terminal_was_running or window_ids is {} then -- Terminal opens an additional window when started or when no window was open tell it to close window 0 end if set the_tap to do script "minicom; exit" activate repeat while the_tap exists delay 0.5 end repeat set window_ids to (id of windows) if window_ids is {} then tell it to quit end if end tell