The WBPP event-script scope does not define the PJSR constants
SampleType_Real or UndoFlag_NoSwapFile, and the bundle has no #include
to supply them. duplicateImageWindow() therefore throws a ReferenceError
at send time, so the master light is produced but no image reaches the
messaging platform (text/stage notifications are unaffected).
Fix keeps the helper self-contained:
- read the floating-point flag from image.isReal (always available)
instead of comparing to SampleType_Real
- guard UndoFlag_NoSwapFile, defining it only if not already in scope
Tested on macOS (Apple Silicon), PixInsight 1.9.4, WBPP 3.0.1, Telegram.
--- a/TheSpaceKoala/NotificationEventScript.js
+++ b/TheSpaceKoala/NotificationEventScript.js
@@ -113,6 +113,11 @@
return exitCode;
};
+// Fallback for the swap-file undo flag if the event-script scope lacks it.
+if (typeof UndoFlag_NoSwapFile === 'undefined') {
+ var UndoFlag_NoSwapFile = 0x80000000;
+}
+
var duplicateImageWindow = function (imageWindow, newId) {
if (!imageWindow || imageWindow.isNull) {
printError('Invalid image window provided for duplication.');
@@ -124,7 +129,7 @@
1,
1,
imageWindow.mainView.image.bitsPerSample,
- imageWindow.mainView.image.sampleType == SampleType_Real,
+ imageWindow.mainView.image.isReal,
false,
newId
);
The WBPP event-script scope does not define the PJSR constants
SampleType_Real or UndoFlag_NoSwapFile, and the bundle has no #include
to supply them. duplicateImageWindow() therefore throws a ReferenceError
at send time, so the master light is produced but no image reaches the
messaging platform (text/stage notifications are unaffected).
Fix keeps the helper self-contained:
instead of comparing to SampleType_Real
Tested on macOS (Apple Silicon), PixInsight 1.9.4, WBPP 3.0.1, Telegram.