Advertisement
shiftdot515

Add to playlist.scpt

Jul 27th, 2019
1,542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tell application "iTunes" -- Add to playlist... this is horny/inflamed/ not hairy , which means bad/touch and go/dicey, so hornier than I thought it would be
  2.     set s to {}
  3.     if player position is not missing value then
  4.         if not (exists playlist "*NEW*") then
  5.             set pl to make playlist with properties {name:"*NEW*"}
  6.         else
  7.             set pl to (playlist "*NEW*")
  8.         end if
  9.         try
  10.             get location of current track
  11.             set s to (s & result)
  12.         on error
  13.             set s to {}
  14.         end try
  15.     else
  16.         repeat with T in selection
  17.             try
  18.                 set s to (s & (location of T))
  19.             end try
  20.         end repeat
  21.         -- now select playlist
  22.         get name of every user playlist of source "Library" whose (special kind is none and smart is false)
  23.         choose from list result with prompt "Add to which playlist?"
  24.         set N to item 1 of result
  25.         get every user playlist of source "Library" whose name is N
  26.         set pl to item 1 of result
  27.         --
  28.     end if
  29.     if (count of s) is not 0 then
  30.         add s to pl
  31.     end if
  32. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement