Script iTunes Lyrics


SUBMITTED BY: Guest

DATE: Jan. 11, 2014, 8:04 p.m.

FORMAT: Text only

SIZE: 1.2 kB

HITS: 1166

  1. tell application "iTunes"
  2. set thisTrack to current track
  3. set title to the name of thisTrack
  4. set TIDs to AppleScript's text item delimiters
  5. try
  6. set AppleScript's text item delimiters to space
  7. set itemList to (text items of title) as list
  8. set AppleScript's text item delimiters to "_"
  9. set title to (itemList as text)
  10. set AppleScript's text item delimiters to TIDs
  11. on error
  12. -- make sure you reset TID's
  13. set AppleScript's text item delimiters to TIDs
  14. end try
  15. set author to the artist of thisTrack
  16. set TIDs to AppleScript's text item delimiters
  17. try
  18. set AppleScript's text item delimiters to space
  19. set itemList to (text items of author) as list
  20. set AppleScript's text item delimiters to "_"
  21. set author to (itemList as text)
  22. set AppleScript's text item delimiters to TIDs
  23. on error
  24. -- make sure you reset TID's
  25. set AppleScript's text item delimiters to TIDs
  26. end try
  27. tell application "Safari"
  28. tell window 1
  29. set myURL to "http://lyrics.wikia.com/" & author & ":" & title
  30. set current tab to (make new tab with properties {URL:myURL})
  31. end tell
  32. end tell
  33. end tell

comments powered by Disqus