Advertisement
Guest User

Untitled

a guest
May 28th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tell application "iTunes"
  2.     set current_track to the current track
  3.     set track_artist to the artist of the current track
  4.     set track_name to the name of the current track
  5.     set track_album to the album of the current track
  6. end tell
  7.  
  8. set searchTerm to track_artist & " " & track_name & " lyrics"
  9.  
  10. #
  11. # The following code is needed if you want to substitute spaces with plus signs in the google search string
  12. #
  13. set thewords to words of searchTerm
  14. set oldtids to AppleScript's text item delimiters
  15. set AppleScript's text item delimiters to "+"
  16. set googString to thewords as text
  17. set AppleScript's text item delimiters to oldtids
  18. #
  19. #
  20. # If you wish to use plus signs, you can change searchTerm in the following string to the googString
  21. #
  22. set serURL to "http://www.google.com/search?client=safari&rls=en-us&q=" & searchTerm & "&ie=UTF-8&oe=UTF-8"
  23.  
  24. tell application "Safari"
  25.     open location serURL
  26.     activate
  27. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement