Guest User

Untitled

a guest
Jul 15th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. tell application "iTunes"
  2. # set silenceTrack to track "Silence - 10 Seconds"
  3.  
  4. reveal (some playlist whose special kind is Music)
  5. set shuffle mode to albums
  6. set shuffle enabled to true
  7. stop
  8. play
  9. pause
  10.  
  11. repeat
  12. set question to display dialog "Add this album?" buttons {"Done", "Skip Album", "Add Album"} default button 3
  13. set answer to button returned of question
  14.  
  15. if answer is equal to "Done" then
  16. set shuffle enabled to false
  17. exit repeat
  18. end if
  19.  
  20. if answer is equal to "Skip Album" then
  21. set startCurrentAlbum to album of current track
  22. repeat
  23. next track
  24. set currCurrentAlbum to album of current track
  25.  
  26. if startCurrentAlbum is not equal to currCurrentAlbum then
  27. exit repeat
  28. end if
  29. end repeat
  30. end if
  31.  
  32. if answer is equal to "Add Album" then
  33. set startCurrentAlbum to album of current track
  34. repeat
  35. duplicate current track to playlist "Up Next"
  36. next track
  37. set currCurrentAlbum to album of current track
  38.  
  39. if startCurrentAlbum is not equal to currCurrentAlbum then
  40. # duplicate silenceTrack to playlist "Up Next"
  41. exit repeat
  42. end if
  43. end repeat
  44. end if
  45. end repeat
  46. end tell
Add Comment
Please, Sign In to add comment