Here is what you need:
- The invisible report is generated invisible, but it will be the last window created
- Using “Get Window List()” combined with “Get Window Title”
windowList = Get Window List()<< Get Window Title();
you will see the titles of the window and see the Report: Untitled # will be the last entry.
- With that knowledge and assuming you do not add additional windows in-between you can close that window using
Window(windowList[N Items(windowList)]) << close window;
- Your script should then look like this:
myjrn = Current Journal();
myjrn << Set page setup( margins( 0.75, 0.75, 0.75, 0.75 ), scale( 0.65 ), portrait( 1 ), paper size( "A4" ) );
myjrn << Set Print Headers( "My Header", "", "Page &pn; of &pc;" );
myjrn << Save PDF( "MyFile.pdf", Show Page Setup( 0 ) );
myjrn << close window; // in case you want the journal closed
windowList = Get Window List()<< Get Window Title();
Window(windowList[N Items(windowList)]) << close window;
Of course you could be even smarter and check any window title with “Report: Untitled…” in the name and close these. But that’s another story
Another alternative is to use "Current Report". In general I try to reference to windows explicitly (e.g. through names I grab or assigning if possible. "Current journal" a or "current report" or "current data table" always have a chance to refer to the wrong window/table/report in case there are either multiples open or the user has time to do something in-between.
I cannot say something about why the behaviour changed with JMP 15 but support@jmp.com may be able to answer this question.
All the best, Martin
/****NeverStopLearning****/