Embedded vs Shell script?

Posted on
Fri Aug 26, 2016 2:32 pm
Gusten offline
Posts: 171
Joined: Dec 30, 2015
Location: Sweden, Gothenburg

Embedded vs Shell script?

Hi
Iam trying to lern python, and am wondering if someone can explain when i should use embedded script files and when i should use the Shell script option.

Whats the the differens between them?

/Martin


Skickat från min iPhone med Tapatalk

Posted on
Fri Aug 26, 2016 3:09 pm
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Embedded vs Shell script?

If you're writing Python scripts that talk directly to Indigo, then you always want to use the Execute Script action (as opposed to the Run Shell Script action, which will run any shell script but won't have direct access to Indigo objects).

Now, in the Execute Script action, there are two options: execute a script file or execute an embedded script. Check the docs for the differences. I generally recommend only doing the smallest of scripts embedded and run the rest as separate files. But it's really a matter of personal preference.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Aug 27, 2016 12:37 am
Gusten offline
Posts: 171
Joined: Dec 30, 2015
Location: Sweden, Gothenburg

Re: Embedded vs Shell script?

Thanx, a followup question. Whats the limitation when running script file? It seems like running scriptfile is the way to go when you always have easy access to indigo even when you have a script that is not talking to indigo. But since there is the Shell script option there must be som limitations using execute script action ?


Skickat från min iPhone med Tapatalk

Posted on
Sat Aug 27, 2016 8:50 am
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Embedded vs Shell script?

No limitations - it can run forever if you want. The Run Shell Script option is a generic shell script function - it'll run bash, ksh, whatever shell script you want. As I pointed out, Python scripts run that way are run directly by the python interpreter, therefore don't have access to the IOM. General rule I would use is run all Python scripts in Execute Script, run other shell scripts via Run Shell Script.

Oh, and I guess I should reiterate the Execute Script will only run Python or AppleScripts because those are the two built-in scripting languages.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 16 guests