question: private Set < String > runningApplications ( ) { String running = executeAppleScript ( new String [ ] { "tell application \"System Events\"" , "	name of processes" , "end tell" } , null ) ; String [ ] apps = running . split ( ", " ) ; Set < String > retval = new HashSet < String > ( ) ; for ( int i = 0 ; i < apps . length ; ++ i ) retval . add ( apps [ i ] ) ; return retval ; }
target:  Checks whether the specified Macintosh web browser is currently running.  You should only call this function if you have already checked that you are running on a Mac.