It took awhile to figure this out. Some information is missing regarding how to go from the Sonos plug-in inserting the URL (ZP_Art state) into a variable to getting the variable (ZP_Art URL) to update the "Refreshing Image URL" element on a web page. I used this simple AS(Apple Script):
tell application "IndigoServer"
set _Source to value of variable "SonosArt" as text
--SonosArt is the variable name
end tell
tell application "Finder"
do shell script "curl _Source -o
file:///Library/Application%20Support/Perceptive%20Automation/images/Sonos/Library_art.jpg"
--Library_art.jpg is the target file
end tell
I use a trigger to run the above script every time Sonos changes tracks (Device State Change)
The AS works embedded in a trigger but I have had problems with embedded AS in the past. Is there anyone who could show me the Python script to accomplish the same thing? I understand embedded Python script is less harmful than an embedded AS. Sorry for the redundant posts but I have spent hours trying to figure this out. Thank you.