question: private static String [ ] selectFileCommand ( File file ) { String path = null ; try { path = file . getCanonicalPath ( ) ; } catch ( IOException err ) { path = file . getAbsolutePath ( ) ; } String [ ] command = new String [ ] { "osascript" , "-e" , "set unixPath to \"" + path + "\"" , "-e" , "set hfsPath to POSIX file unixPath" , "-e" , "tell application \"Finder\"" , "-e" , "activate" , "-e" , "select hfsPath" , "-e" , "end tell" } ; return command ; }
target:  Launches the Finder and selects the given File