Subscribe Bookmark RSS Feed

Run JSL from OLE

thechadd

Community Trekker

Joined:

Jun 23, 2011

Hey all!

I'm new to OLE, but I have managed to at least get tables opened and run basic JMP commands through Perl.

Now I am trying to do the following:
Open JMP
Run a JSL (preferably from a saved .jsl file)
close JMP.

I've been sifting through the Automation reference, and I'm starting to think this is impossible. Any ideas? (even if not in Perl, I can translate)

Cheers!
Chadd
5 REPLIES
Hello Chadd,

Within the JMP automation interface there are two methods to running or executing JSL code:
RunJSLFile(JSL filename path);
RunCommand(JSL text);

Both are self explanatory.

Cheers,

-Win
thechadd

Community Trekker

Joined:

Jun 23, 2011

Thanks Win!

I tried both of those and neither seem to result with an Instance of JMP opening and becoming visible. However, I do see the process run briefly and close. I can copy and paste examples from the web that open tables and run commands on them, everything works fine.

Am I missing something a key line in my script below?

use OLE;
use Win32::OLE;
$jmp = Win32::OLE->new('JMP.Application');
$jmp->{'Visible'} = 1;
$jmp->RunJSLFile("file.jsl");
Try removing the single quotes from {'Visible'}.
thechadd

Community Trekker

Joined:

Jun 23, 2011

I get nothing if I remove the quotes from Visible. Here is an example of code that does work...
use OLE;
use Win32::OLE;
$jmp = Win32::OLE->new('JMP.Application');
$jmp->{'Visible'} = 1;
$jmp->OpenDocument("C:/Program Files (x86)/SAS/JMP/9/Support Files English/Sample Data/Big Class.jmp");

I'm not sure how the other example is any different. Here's something even more strange. If I have the above code, and I tack on the RunJSLFile to it, it runs. So do I have to open a table before I do *anything* else for JMP OLE automation?

use OLE;
use Win32::OLE;
$jmp = Win32::OLE->new('JMP.Application');
$jmp->{'Visible'} = 1;
$jmp->OpenDocument("C:/Program Files (x86)/SAS/JMP/9/Support Files English/Sample Data/Big Class.jmp");
$jmp->RunJSLFile("file.jsl");

Message was edited by: The Chadd
Hi Chadd,

Please open up a track with JMP Technical Support so that I may work on it with more visibility. I don't normally check this forum as often.

Thanks,

-Win