Author Topic: Launch process icon from script  (Read 796 times)

Offline hvb356

  • Member
  • *
  • Posts: 63
    • View Profile
Launch process icon from script
« on: 2017 December 06 04:45:57 »
Hi All,

my question to scripting: is it possible to load a process icon file into workspace?

I've tried to launch the icon (*.xpsm) using

      let P = new ExternalProcess();
      P.start(filename);

The process returned 0, but nothing happened. I also checked this way with a txt-file witout success. Merely exe-files execute instantly.

When I execute process.start("c:\\...\\myIcon.xpms") in a Windows program, the icon pops up in PI.

What am I doing wrong?

Thanks in advance for your answer.

Hartmut

scripting is not as easy, as it often sounds.. ;)
TOA-150, ML8300, CFW2-7 w. Astronomik HaLRGB, PDF, EM-400, guiding FS-60 + ST402, ASCOM bsd. image acquisition

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2131
    • View Profile
Re: Launch process icon from script
« Reply #1 on: 2017 December 09 06:03:06 »
Hi Hartmut,

I am not sure I understand what you are trying to do. Here some hints:
- ExternalProcess() is intended to start an operating system process external to PixInsight. For instance, you could use it to launch MS Word from inside PixInsight. I know the PJSR documentation is woefully incomplete, but it sometimes helps to search for equivalent classes in the PCL, and (with some fantasy) try to understand how it has been translated into Javascript. I the case of PJSR External process, have a look at PCL::ExternalProcess here: http://pixinsight.com/developer/pcl/doc/html/classpcl_1_1ExternalProcess.html
- If you are trying to call execute a PixInsight process icon from inside a PJSR script: the BatchPreprocessing script does something similar to optionally execute a user provided CosmeticCorrection icon. The corresponsing code can be found in BatchPreprocessing-GUI.js around line 903 (list existing icons of type CosmeticCorrection), and BatchPreprocessing-engine.js line 1033 (execution).
- Or was it something else that you are trying to do?

Best greetings,
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline hvb356

  • Member
  • *
  • Posts: 63
    • View Profile
Re: Launch process icon from script
« Reply #2 on: 2017 December 12 07:19:39 »
Hi Georg,

following your proposal using a proxy like cmd.exe works.

Problem solved.

Thanks

Hartmut
TOA-150, ML8300, CFW2-7 w. Astronomik HaLRGB, PDF, EM-400, guiding FS-60 + ST402, ASCOM bsd. image acquisition