Author Topic: Restore script from process icon?  (Read 1307 times)

Offline TinySpeck

  • PixInsight Enthusiast
  • **
  • Posts: 81
Restore script from process icon?
« on: 2020 February 12 19:27:26 »
I used the WeightedPostProcessing script on my last image and would like to start from the settings I made there on my next image.  I saved the process icon for WPP, but when I double-click the icon and then click Apply Global it attempts to run the script and fails.  All I want to do is load WPP with the last set of parameters, modify them, and then run the script when I'm ready.  It seems like Apply Global has done this for me before, but not now.  Any way to do this?
Gerrit

Offline stevek

  • PixInsight Addict
  • ***
  • Posts: 148
Re: Restore script from process icon?
« Reply #1 on: 2020 February 13 08:15:32 »
Right click it and "execute in the global context" and it will bring up the WBPP config window.

Offline TinySpeck

  • PixInsight Enthusiast
  • **
  • Posts: 81
Re: Restore script from process icon?
« Reply #2 on: 2020 February 13 09:20:04 »
Thanks, stevek.  This gives me the same result as I described.  I think "apply global" does the same thing as "execute in the global context".  I'm getting an MD5 checksum error when I do either so maybe PI isn't actually trying to execute the script as I thought, but it's failing to load the WPP config window.

More experimenting tonight -- I'll try to get to the bottom of the MD5 checksum error.
Gerrit

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Restore script from process icon?
« Reply #3 on: 2020 February 13 10:24:53 »
The checksum error is the expected behavior when you try to execute a modified script from an existing instance, including a different version of a script referenced from a process icon. So this happens because your icon refers to a version of WBPP that is different (most likely older) than the current version.

To fix this, simply launch the Script tool (by double clicking the icon) and remove the MD5 checksum. Then you can execute the script without problems (e.g., by clicking Apply Global from the Script window).

Script checksums are a security enforcement feature. Scripts are potentially dangerous because they necessarily have to expose their source code. If something or someone modifies a script maliciously without your permission, really bad things could happen (no need to scare people by being more explicit, right?), since PixInsight's JavaScript runtime is extremely powerful (much more than a typical web browser for example).

The idea behind these MD5 checksums is simple: By forcing you to clear a code checksum before executing a script that is different from the original code that created a process icon, the responsibility for what happens next is entirely yours ;)

In summary, if you try to execute a process icon and you get a checksum mismatch error, you should always ask yourself: has this script been changed by means of a recent update, of after installing a new version of PixInsight? If yes, and you clearly know it, then run it via Script by clearing the checksum. If not, then something strange is happening.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline TinySpeck

  • PixInsight Enthusiast
  • **
  • Posts: 81
Re: Restore script from process icon?
« Reply #4 on: 2020 February 13 10:31:14 »
Perfect, Juan, that did it!  Thank you for the complete explanation -- that would have taken me a long time to figure out...
Gerrit