Set variable from command line

Posted on
Wed Jul 01, 2015 10:33 am
Peter Beyt offline
Posts: 8
Joined: Mar 15, 2014

Set variable from command line

I hope this finds everyone healthy and happy!

Please, can anyone tell me if there is a cleaner way to do this? ---------

From a remote machine using ssh I call to execute one of two Applescripts like this one:

#!/usr/bin/osascript
tell application "IndigoServer" to set value of variable "database_busy" to false


************* IS THERE A BETTER WAY ?????????????

The operation must be call and exit on the remote machine…..
Any ideas you lovely smart people?

thanks peter

PEACE

Posted on
Wed Jul 01, 2015 1:28 pm
Peter Beyt offline
Posts: 8
Joined: Mar 15, 2014

Re: Set variable from command line

Will this be more reliable than the above?

/Library/Application\ Support/Perceptive\ Automation/Indigo\ 6/IndigoPluginHost.app/Contents/MacOS/IndigoPluginHost -e indigo.variable.updateValue\(1730190951,\ value=unicode\(\"lock\"\)\)

Thanks

Posted on
Thu Jul 02, 2015 9:03 am
jay (support) offline
Site Admin
User avatar
Posts: 16815
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Set variable from command line

Either of those are fine. You could also use the Indigo RESTful API with curl...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 02, 2015 11:39 am
Peter Beyt offline
Posts: 8
Joined: Mar 15, 2014

Re: Set variable from command line

Thanks Jay,
Could you give me the equivalent RESTful API with curl. call?
I never realized how challenging it can be to get a command line to pass through
all the right channels, Script>SSH>Script>Indigo.
But first, I'm really interested in the most reliable way of doing it!
If I could do this all over eppc:// machine calls, it would be easy, but they hang and
with eight computers working like gears in a clock, one locks, they all lock!
Least interpretation and compiling is what I'm after.
Because I'm sending this command from another computers SSH script and
my execution time is mission critical, I sometimes get hung by the #!/usr/bin/osascript interpreter.
Maybe the real question is how to pass variables between IndigoServers,
I'm building a TV station, there is a lot going on between machines……

Thanks
peter
PEACE

Posted on
Thu Jul 02, 2015 12:18 pm
RogueProeliator online
User avatar
Posts: 2437
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Set variable from command line

Maybe the real question is how to pass variables between IndigoServers

For real-time performance between two actual servers, your absolute best bet might be a plugin that keeps a communication channel between the two up at all times...

Adam

Posted on
Thu Jul 02, 2015 1:12 pm
Peter Beyt offline
Posts: 8
Joined: Mar 15, 2014

Re: Set variable from command line

Thanks Adam,
You are right! But I'm a bit overwhelmed with the software
I need to get up and running, I'll need to put it on a wish list!
I grew up in Lafayette, mom tells me it's raining everyday right now!
But, I digress. Because, at the moment, this variable is only to stop
IndigoServers from accessing the same files at the same time,
I'm hoping to do it cheaply (without a big time investment).
It's easy to see what a real pipe between servers could do.
In this high level software world, you ask a machine to do something
and 90% it does on time! But your viewers don't like seeing 10%
of on air mistakes and you don't want to have to give back 10%
of your billings! I'm just saying if I ever get that far!

THANKS
PEACE
peter

Posted on
Thu Jul 02, 2015 4:45 pm
matt (support) offline
Site Admin
User avatar
Posts: 20568
Joined: Jan 27, 2003
Location: Texas

Re: Set variable from command line

Hi Peter,

I'd definitely avoid remote eppc:// calls, and probably avoid AppleScript/osascript. AppleScript just isn't my endorsed solution for reliability these days.

Using IndigoPluginHost -e should be reliable, but the problem is it has to spin up a new process and connect to the Indigo Server each time. The Indigo Server overhead on that is pretty minimal, but there still might be some delay as the process has to start up. If it seems too slow then using curl in a shell script to the RESTful API will likely be faster, as it will be accessing Indigo's always-running web server. Here is an example:

Code: Select all
 curl -u username:password --anyauth -X PUT -d value=false http://127.0.0.1:8176/variables/database_busy

Image

Posted on
Thu Jul 02, 2015 5:41 pm
Peter Beyt offline
Posts: 8
Joined: Mar 15, 2014

Re: Set variable from command line

Now that's what I'm talking about…..

THANKS

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest