PixInsight Forum (historical)

Software Development => PCL and PJSR Development => Topic started by: Mike Reid on 2011 June 27 21:28:09

Title: Blue Triangle in PJSR
Post by: Mike Reid on 2011 June 27 21:28:09
I've been trying to implement the new instance, blue triangle in a script by following Juan's advice in this thread,
  http://pixinsight.com/forum/index.php?topic=2177.msg14242#msg14242
I was lead to the example in DrawSignature.js.  But the blue triangle in DrawSignature does not seem to work quite right.  At least not with PixInsight 1.7 on x86_64 linux.  When I try to drop the triangle on an image I get this error,
  Attempt to execute a Script instance recursively.
  Sorry, but this is not supported in this version of PixInsight.
I can drag the triangle to the desktop and create a new instance and later drag it to an image and it does work.

Is something missing from this script or am I missing something?

Thanks,
Mike
Title: Re: Blue Triangle in PJSR
Post by: georg.viehoever on 2011 June 27 23:51:21
Hi Mike,

this unfortunately is one of the limitations of scripting. It also happens with Canon Banding etc.. To apply a scipt directly to an image, you have to use the apply button.
Georg
Title: Re: Blue Triangle in PJSR
Post by: Juan Conejero on 2011 June 28 00:10:10
Hi Mike,

More information on this topic here:

http://pixinsight.com/forum/index.php?topic=3159.msg21709#msg21709

Summarizing, you must implement a way to apply your script to one or more images (or disk files etc.) within your script. Then the user can generate instances of your script as new process icons with the blue triangle mechanism. These instances can then be applied to images without requiring a modal session (that is, without opening your script's main dialog) if appropriate, if you implement your script correctly.
Title: Re: Blue Triangle in PJSR
Post by: Ioannis Ioannou on 2011 June 28 00:40:20
Juan was faster than me :)
Also take  a diff between the original script from here (the last one) http://pixinsight.com/forum/index.php?topic=806.15 (http://pixinsight.com/forum/index.php?topic=806.15) and the one I have put the triangle http://pixinsight.com/forum/index.php?topic=3139.0 (http://pixinsight.com/forum/index.php?topic=3139.0)
Title: Re: Blue Triangle in PJSR
Post by: georg.viehoever on 2011 June 28 01:33:02
Summarizing, you must implement a way to apply your script to one or more images (or disk files etc.) within your script.
Once you can create instances with the blue triangle, you can also drag this instance onto an image containter to apply it to a number of images. This is how I apply CanonBandingReduction to multiple images.
Georg
Title: Re: Blue Triangle in PJSR
Post by: Mike Reid on 2011 June 28 10:57:24
Thanks guys.  This makes more sense now.

Mike