Page 1 of 1

http server request from applescript?

PostPosted: Sat Jan 01, 2011 2:00 pm
by mat
Hi,

I'm just trying to intergrate sonos with indigo and and playing with sonospy - a python controller for sonos. I have the python controller running, which has a html from end.

I know from the chap writing the python code, that I can send http requests straight to the the controller ie

http://ip_address_of_machine_running_so ... ?data=PLAY

my question is how would i send the above request from applescript - my logic script writing is basic, but server reqests etc are way beyond me! If the answer is simple, could someone point me in a direction or provide an example. I've searched and googled and I can see very complex examples. Is it that tricky?

Also, I'm trying to avoid having a random safari window open.
Cheers in advance,

Mat

Re: http server request from applescript?

PostPosted: Sat Jan 01, 2011 4:03 pm
by CharlieParker
How does this work for?
Code: Select all
tell application "URL Access Scripting"
   download "http://ip_address_of_machine_running_sonospy:50101/data/rendererAction?data=PLAY" to "/tmp/sonos.html" replacing yes
end tell

Re: http server request from applescript?

PostPosted: Sat Jan 01, 2011 4:26 pm
by mat
Thanks charlie ... I've got sonos volume control from within indigo

much love!

:lol:

Re: http server request from applescript?

PostPosted: Thu Jun 28, 2018 2:13 pm
by noel1983
Resurrecting a super old thread but wondered if anyone could be kind enough to tell me how I'd do this with Python? I know nothing about Python but conscious applescript is on the way out

Thanks
Noel

Re: http server request from applescript?

PostPosted: Thu Jun 28, 2018 2:21 pm
by Colorado4Wheeler
You don't have to do away with your AS, it doesn't target Indigo. You can put it into Mac Commander and then no matter what Indigo does with AS you'll be able to use your script.

Re: http server request from applescript?

PostPosted: Thu Jun 28, 2018 3:07 pm
by mat
Wow, that was an old post, and a precursor to the sonos plugin.