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;
}

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 ; }
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 .
