Author Topic: Hello World Writing Scripts Tutorial  (Read 5409 times)

Offline peabody1998

  • Newcomer
  • Posts: 10
Hello World Writing Scripts Tutorial
« on: 2019 November 14 12:08:51 »
I'm an old programmer but am new to PixInsight development.  I would greatly appreciate if someone could point me in the right direction to a "Hello World" beginners tutorial on how to start writing scripts in PixInsight. I am firstly interested in developing scripts to automate workflow. TIA.
-- Rich

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Hello World Writing Scripts Tutorial
« Reply #1 on: 2019 November 14 16:23:52 »
In Script Editor View:

File > New > JavaScript Source file (.js)
Paste text below, save
Execute > Compile & Run

Include files are in Pixinsight/include/pjsr.
Distribution script source files (ie examples) in Pixinsight/src/scripts.

Classes, methods, and parameters are listed in Object Explorer View. No additional docs, but names themselves are a helpful prompt.

Code: [Select]
#include <pjsr/StdIcon.jsh>
#include <pjsr/StdButton.jsh>

console.writeln("Hello world");

(new MessageBox(
   "Hello world",
   "",
   StdIcon_Information,
   StdButton_Ok
)).execute();

Offline peabody1998

  • Newcomer
  • Posts: 10
Re: Hello World Writing Scripts Tutorial
« Reply #2 on: 2019 November 14 17:47:10 »
Thanks. Works perfectly!
And away I go.....

--Rich