- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Lock journal through scripting
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Lock journal through scripting
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" );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Lock journal through scripting
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");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Lock journal through scripting
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" );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Lock journal through scripting
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);