Code: Select all
import applescript
script_source = 'tell application "iTunes" to play (first track of playlist "Radio" whose name is "Sky Radio 101 FM")'
script = applescript.AppleScript(source=script_source)
reply = script.run()
Code: Select all
import subprocess
command = ['osasript','-e', 'tell application "iTunes" to play first track of playlist "Music" whose name is "iTunes PList 13 NPR"']
p = subprocess.check_output(command)
Nor did this.
Code: Select all
import applescript
script source = 'tell application "iTunes" to play playlist "iTunes PList 13 NPR"'
script = applescript.AppleScript(source=script_source)
reply = script.run
OTOH, this works fine to directly address iTunes and speak the weather:
Code: Select all
itunesId = "com.perceptiveautomation.indigoplugin.itunes"
itunesPlugin = indigo.server.getPlugin(itunesId)
if itunesPlugin.isEnabled():
myWeatherStation = indigo.devices[976449363]
outsideTemp = myWeatherStation.states['temperatureF']
currentCondition = indigo.variables["WeatherNOAA_Day1Period1TextForecast"] #speaking the entire weather forecast
itunesPlugin.executeAction("pause", deviceId=772048342)
https://wiki.indigodomo.com/doku.php?id ... g_tutorial
Is there a set of direct commands that can be put in a python script to call simple functions like "play playlist"?
Thanks!
Ham