Scripting options

RobF2

Well-known member
OK, pardon my ignorance, but does all scripting in PI have to be done in PJSR?  There is no simple high level "batch script" type syntax possible?  (or could I call the PI class library from VB.NET for example?).

I exploring options to automate common procedures (particularly pre-processing things that bug me).


Thanks for any clarification.
 
Hi Rob,

Yes, you can write a shell script in PixInsight. You have an example in the startup.scp script (you'll find it on the bin installation folder), which PixInsight executes automatically upon startup. Basically, you can write everything you can execute from the command line as a script and run it as a batch process. You can even embed JavaScript fragments in a PI shell script.

However, there are some limitations in PI shell scripts. The main one is that, unfortunately, not all processes have a command-line interface available. This happens because we or the authors of those processes still haven't had the time to implement the required command-line support routines. In other cases, a command-line interface doesn't make sense, such as highly interactive tools.

These limitations will be overcome in the future, but right now you have to check if the processes that you want to run can be executed from the command line (other than to launch their interfaces, which is available for all processes).

Having said that, I personally recommend you write all your batch procedures as JavaScript scripts in PixInsight. The PJSR is much more powerful and flexible, and doesn't have any of the limitations that I have described.

Regarding .NET languages, they are incompatible (both technically and philosophically :) ) with PixInsight.

Let me know if you need more information on PI shell scripts.
 
Many thanks for the fast reply Juan

I'd like to play with PJSR but think it's likely I won't have time to get into it too far.  Shell scripts sound like a logical place to start, so will have a closer look at that first as you suggest.  No more mention of .NET - promise  >:D
 
Thanks for asking this, Rob, and thanks for the reply, Juan.  Must admit I've been wondering how I can have PI open things that you pretty much use every time, eg STF, on startup.  Adding it to startup.scp might be the way.  Thanks.
 
Troy, if you find a solution for this (STF especially), I'd love to know. I've done it with a process icon set, but I'd especially like STF to just be open from the beginning.
 
I did.  Just add the line:

Code:
ScreenTransferFunction --interface

to the end of the file Juan mentioned above, startup.scp.

You can also use the default alias:

Code:
stf --interface
 
Back
Top