@ian_jmp . I am trying to use your script in the following way.
I have written a script which loads the data file and plots various charts.
partID = "part012"; // specifies part ID
DataTable = getDataTable4WfrID2(partID,partID); // loads test data table corresponding to the partID and names it the same as partID
include ("allGraphPlotter.jsl"); //plots all necessary charts
The above script works as expected.
Then (on fourth line above), I tried to include your script as below (note the commented lines) for sending the charts to journal but is not working.
Where am I going wrong (perhaps my include statement or the function call e.g. output = namesOfOpenWindows()
)?
NamesDefaultToHere(1);
// Returns a list containing the names of all the currently open windows in a session
namesOfOpenWindows =
Function({}, {DefaultLocal},
openWindows = Window();
openWindowNames = {};
For(w=1, w<=NItems(openWindows), w++, InsertInto(OpenWindowNames, OpenWindows[w] << GetWindowTitle));
openWindowNames;
);
// Which windows are open now?
preWindowList = namesOfOpenWindows();
// Open a table
//dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Find out what scripts are in the table
//dts = dt << GetTableScriptNames;
// Run every script
//for (s=1, s<=NItems(dts), s++, dt << runScript(dts[s]));
// Which windows are open now?
postWindowList = namesOfOpenWindows();
// Journal the contents of each 'new' window
for(w=1, w<=NItems(postWindowList), w++,
thisWindow = postWindowList[w];
if (!Contains(preWindowList, thisWindow), Window(thisWindow) << Journal);
);
When it's too good to be true, it's neither