- iTunes = Application("iTunes");
- function forceQuitiTunes() {
- process = Application("System Events").processes["iTunes"];
- try {
- for(i=0 ; i < 10 && process.exists() ; i++){
- iTunes.quit({timeout: 60});
- delay(1);
- }
- }
- catch(e) {}
- if(!process.exists())
- return;
- app = Application.currentApplication();
- app.includeStandardAdditions = true;
- app.doShellScript("iTunes=" + process.unixId() + "\n\
- for i in {1..10} \n\
- do \n\
- sleep 1 \n\
- kill -0 $iTunes || exit 0 \n\
- kill -9 $iTunes \n\
- done 2> /dev/null");
- }
- forceQuitiTunes();
- iTunes.reveal(iTunes.sources["Library"].userPlaylists["Internet Songs"].urlTracks["181.FM - True R&B"]);
Relaunch iTunes