URL commands

Posted on
Fri Apr 20, 2012 6:58 pm
Bigfatburrito offline
Posts: 49
Joined: Nov 13, 2011

URL commands

This may be a very basic question...please forgive me. How do I send URL commands via indigo? Is that possible?

Thanks

Posted on
Sat Apr 21, 2012 3:26 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: URL commands

Could you give an example of what you're wanting to do? I'm not sure what you mean by "URL commands."

Posted on
Sat Apr 21, 2012 8:52 am
Bigfatburrito offline
Posts: 49
Joined: Nov 13, 2011

Re: URL commands

Thanks for the reply...I may not be using terms correctly. I can control my red eye (thinkflood) by typing a URL into my web browser, and control my AV/Home Theater equipment via the red eye. I was wondering if there was a way to send that same URL via indigo with a script or something else. The idea would be to hit a button, send the URL (as if I typed it into a browser), and activate the red eye. Hope that helps.

Thnks

Posted on
Sat Apr 21, 2012 9:22 am
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: URL commands

How about using curl from AppleScript?

Code: Select all
Do shell script "curl http.........."


Include the speak marks,and replace .....

Mat

Late 2018 mini 10.14

Posted on
Sat Apr 21, 2012 10:32 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: URL commands

I'm not terribly familiar with it, but the Cynical Network plugin may do it with no scripting.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Apr 21, 2012 12:33 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: URL commands

mat wrote:
How about using curl from AppleScript?

To expand on mat's suggestion, you could create Control Page in Indigo. A Control Page adds a web page to the built-in Indigo web server. On the new Control Page, you could add a "Static Image/Caption" object that has one of the button image included with Indigo associated with it. The server action associated with that Static Image/Caption object would be to Execute Script (AppleScript type). Within the text entry area for that Execute Script action, you'd put
Code: Select all
do shell script "curl <your custom URL here>"
where <your custom URL here> is the URL that controls your Red Eye or your AV system.

Posted on
Sun Apr 22, 2012 2:19 am
Bigfatburrito offline
Posts: 49
Joined: Nov 13, 2011

Re: URL commands

Thx all for the suggestions...I'll try them

Posted on
Tue Apr 24, 2012 10:03 pm
Bigfatburrito offline
Posts: 49
Joined: Nov 13, 2011

Re: URL commands

That's all for the replies...the "curl" script worked perfectly. One more question. If I wanted to string a couple of actions together with the apple script, but introduce a 5sec delay in between, how would I write that. I appreciate the help, as I am not a programmer...I just enjoy playing with this. I've been able to set up a keypad link button to turn on my devon receiver, which is a problem with the regular insteon ir converter as denon does not recognize the signals.

Thanks again!

Posted on
Tue Apr 24, 2012 10:19 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: URL commands

Bigfatburrito wrote:
?.. If I wanted to string a couple of actions together with the apple script, but introduce a 5sec delay in between, how would I write that.

    do shell script...
    delay 5
    do shell script...

Posted on
Tue Apr 24, 2012 10:34 pm
Bigfatburrito offline
Posts: 49
Joined: Nov 13, 2011

Re: URL commands

Thanks...that's what i thought, but it didn't seem to work...I'll try again. Thanks for the help

Posted on
Tue Apr 24, 2012 10:38 pm
Bigfatburrito offline
Posts: 49
Joined: Nov 13, 2011

Re: URL commands

Thanks...it worked when I put the delay into parenthesis
do shell script...
(delay 5)
do shell script...

Posted on
Tue Apr 24, 2012 10:41 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: URL commands

Parents shouldn't be necessary... Can you post your script, there may be some tweaks that could help.

Posted on
Wed Apr 25, 2012 1:05 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: URL commands

berkinet wrote:
Bigfatburrito wrote:
?.. If I wanted to string a couple of actions together with the apple script, but introduce a 5sec delay in between, how would I write that.

    do shell script...
    delay 5
    do shell script...

If you're going to use AppleScript to create a delay of more than 1 second, I'd recommend doing it in an external script rather than an embedded one, simply because embedded AppleScripts run in the main Indigo thread and a "delay 5" in an imbedded script will cause the entire server to hang for 5 seconds while waiting for the embedded script to finish. If you don't want to use an external AppleScript, you could create a second action step for the trigger that is delayed by 0.08 minutes (check box at the bottom of the action step) and put your second "do shell script" command in there. That makes everything editable from within the Indigo Client, eliminates server hangs, and preserves the functionality of what you're trying to do.

Posted on
Fri May 11, 2012 6:56 pm
Bigfatburrito offline
Posts: 49
Joined: Nov 13, 2011

Re: URL commands

Thanks for the replies...I haven't checked this post in awhile, since I was able to do things a little different. I use a red eye remote (think flood) to control my AV equipment. This allows me to set up an activity such as "watch TV". I can then use the URL of that activity, and I just do shell script curl... and voila the whole thing goes. So the delay within the scripting has become a moot point....however, I appreciate all of the help!

Posted on
Sun May 13, 2012 2:04 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: URL commands

Glad to hear all is working out well with the script setup.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests