Track track = getSelectedTrack(); File trackfile = track.getFile(); if (trackfile.exists()) { System.out.println("Show track file: " + trackfile); String macpath = "file \"" + trackfile.getName() + "\" of "; while ((trackfile = trackfile.getParentFile()) != null) { if (!trackfile.getName().equals("")) macpath = macpath + "folder \"" + trackfile.getName() + "\" of "; } macpath = macpath + "startup disk"; System.out.println("Mac path: " + macpath); try { Process script = Runtime.getRuntime().exec("/usr/bin/osascript"); PrintStream out = new PrintStream(script.getOutputStream()); out.println("tell application \"Finder\""); out.println("    activate"); out.println("    select " + macpath); out.println("end tell"); out.close(); script.waitFor(); } catch (Exception ex) { ex.printStackTrace(); } } }
trackTable.setSortColumn(4); }
        public void widgetSelected(SelectionEvent e) {          Track track = getSelectedTrack();          File trackfile = track.getFile();          if (trackfile.exists()) {            System.out.println("Show track file: " + trackfile);            String macpath = "file \"" + trackfile.getName() + "\" of ";            while ((trackfile = trackfile.getParentFile()) != null) {              if (!trackfile.getName().equals(""))                macpath = macpath + "folder \"" + trackfile.getName() + "\" of ";            }            macpath = macpath + "startup disk";            System.out.println("Mac path: " + macpath);            try {              Process script = Runtime.getRuntime().exec("/usr/bin/osascript");              PrintStream out = new PrintStream(script.getOutputStream());              out.println("tell application \"Finder\"");              out.println("    activate");              out.println("    select " + macpath);              out.println("end tell");              out.close();              script.waitFor();            } catch (Exception ex) {              ex.printStackTrace();            }          }        }