public static boolean addAudioFile ( final File file ) throws IOException { if ( ! SystemUtils . IS_OS_MAC_OSX ) { LOG . debug ( "Not on OSX, not adding to iTunes" ) ; return false ; } if ( ! isSupported ( file ) ) { LOG . debug ( "iTunes does not support this file type: {}" , file ) ; return false ; } //final Runnable runner = new ExecOsaScript(file.getCanonicalFile()); //final Thread thread = new DaemonThread(runner, "iTunes-Adding-Thread"); //thread.start(); Runtime . getRuntime ( ) . exec ( createOSAScriptCommand ( file ) ) ; return true ; }
Adds the specified audio file to iTunes if we re on OSX .