In recent versions of JMP we now have the option to lock journals. How can I incorpoerate that into my scripts? I expect it to be something like:
current journal() << lock;
The journal window has to be the active window. This works for me.
Window( "Journal: Untitled" ) << Bring Window to Front; Wait( 0 ); Main Menu( "Lock Journal" );
Edit:
There's a better way. You can specify the window within the Main Menu() function.
Main Menu( "Lock Journal", "Journal: Untitled" );
Did anyone ever find a way to do this? I had the same assumption, that the syntax would be similar to what you put, but it doesn't work. I also tried the following and none of them worked either, all of them result in an error.
current journal() << Lock(1); current journal() << LockJournal; current journal() << LockJournal(1); current journal() << SetLock(1);
Error Message:Object 'HeadBox' does not recognize the message '<command>';
I did notice if you look at the "Customize" -> "Menus and Toolbars" window, that the "Edit" -> "Lock Journal" menu command has a Built-in Command of "EDIT:LOCK JOURNAL", but I cannot figure out a way to get the script to run the built in command. I tried these but none worked.
Current Journal() << Main Menu("EDIT:LOCKJOURNAL"); Current Journal() << Run Script( Main Menu("EDIT:LOCKJOURNAL"); );
Error Message: Object 'HeadBox' does not recognize the message 'Main Menu';
I also tried to run this with Journal as active window. Command executes, but doesn't lock the Journal
Main Menu("EDIT:LOCKJOURNAL");
</CODE><CODE class=" language-jsl">
Great, and a little more generic with code references that might be used in other parts of the script:
text box("abc") << journal; jrn = Current Journal(); Main Menu( "Lock Journal", jrn << get window title);
On my computer atleast, this works on JMP 17 but for JMP 18 it failed. Fortunately it looked like a timing problem. This worked:
text box("abc") << journal; jrn = Current Journal(); <STRONG>Wait(0);</STRONG> Main Menu( "Lock Journal", jrn << get window title);