1. iTunes = Application("iTunes");
  2. function forceQuitiTunes() {
  3. process = Application("System Events").processes["iTunes"];
  4. try {
  5. for(i=0 ; i < 10 && process.exists() ; i++){
  6. iTunes.quit({timeout: 60});
  7. delay(1);
  8. }
  9. }
  10. catch(e) {}
  11. if(!process.exists())
  12. return;
  13. app = Application.currentApplication();
  14. app.includeStandardAdditions = true;
  15. app.doShellScript("iTunes=" + process.unixId() + "\n\
  16. for i in {1..10} \n\
  17. do \n\
  18. sleep 1 \n\
  19. kill -0 $iTunes || exit 0 \n\
  20. kill -9 $iTunes \n\
  21. done 2> /dev/null");
  22. }
  23. forceQuitiTunes();
  24. iTunes.reveal(iTunes.sources["Library"].userPlaylists["Internet Songs"].urlTracks["181.FM - True R&B"]);

Relaunch iTunes