@Override public void actionPerformed(ActionEvent e) { BTDownload[] downloaders = BTDownloadMediator.instance().getSelectedDownloaders(); if (downloaders != null && downloaders.length > 0) { try { final BTDownload downloader = downloaders[0]; File saveLocation = downloader.getSaveLocation(); if (downloader instanceof BittorrentDownload) { BittorrentDownload btDownload = (BittorrentDownload) downloader; saveLocation = new File(btDownload.getSaveLocation(), btDownload.getName()); } System.out.println("Sending to iTunes " + saveLocation.getAbsolutePath()); iTunesMediator.instance().scanForSongs(saveLocation); } catch (Exception ex) { ex.printStackTrace(); } } }