anschwa / helm-itunes

Search and play your music with iTunes or Spotify from inside Emacs.
MIT License
20 stars 5 forks source link

incorrect quoting of strings #3

Open MadEarl opened 9 years ago

MadEarl commented 9 years ago

I found that helm-itunes throws an error when trying to play a track that contains a ' character. This is due to incorrect quoting. After some fiddling I found this to work:

(defun helm-itunes-play-track (track) (osascript-run-str (concat "tell application \"" helm-itunes-music-player "\" to play track \"" track "\"")))

This requires the use of the osx-osascript library, which contains a couple of helper functions to create correctly quoted osascript strings. May I suggest to work this into helm-itunes?

anschwa commented 9 years ago

Cool, thanks! It seems that author of osx-osascript.el also has created osx-itunes.el, which might also be useful.