http server request from applescript?

Posted on
Sat Jan 01, 2011 2:00 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

http server request from applescript?

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

Late 2018 mini 10.14

Posted on
Sat Jan 01, 2011 4:03 pm
CharlieParker offline
Posts: 241
Joined: Apr 10, 2006
Location: Lower Hudson Valley

Re: http server request from applescript?

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

Posted on
Sat Jan 01, 2011 4:26 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: http server request from applescript?

Thanks charlie ... I've got sonos volume control from within indigo

much love!

:lol:

Late 2018 mini 10.14

Posted on
Thu Jun 28, 2018 2:13 pm
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Re: http server request from applescript?

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

Posted on
Thu Jun 28, 2018 2:21 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: http server request from applescript?

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.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Thu Jun 28, 2018 3:07 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: http server request from applescript?

Wow, that was an old post, and a precursor to the sonos plugin.

Late 2018 mini 10.14

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests