I am trying to work with this command and experiencing some difficulty.
I am trying to control iTunes at the command line. I have no problem working with the commands or getting vera to execute the instructions from her command line.
When dealing with escaping special characters it’s best to work from the inside out.
You want this command to go to osascript:
tell application "iTunes" to pause
It’s being evaluated by a Bourne shell, which requires quotes to be escaped by backslashes:
osascript -e "tell application \"iTunes\" to pause"
This is put in the middle of an os.execute() call, which takes a Lua string. Lua strings have to escape double quotes and backslashes with backslashes:
I thought that I had managed all that at the command line, but to your point, another shell to get through.
Now that I have the ability to do TTS over AirPlay, I’m trying to get this to behave nicely with iTune (e.g. pause the music (if it is playing) and start it back up after the message plays).
I’m sort of impressed with applescript. I surprised there isn’t much chatter on this board trying to get Vera to squeeze things out of a mac.
I’m afraid that by the time I get everything in there that I want, I’ll have an AirPlay plugin for OSX…
Best Home Automation shopping experience. Shop at Ezlo!