cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to move from signal modeling to system modeling at the first JMP Aerospace Analytics webinar. Register. June 18, 1 p.m. US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
MathStatChem
Level VII

Get selected text in Script Box

Does anyone know of a way with JSL to get the text and the line number(s) of selected text in a Script Box with JSL?  E.g.

MathStatChem_0-1781029877391.png

I want to return "Text 1 , " and {3,4}

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Get selected text in Script Box

I think you can do it (in basic cases) with combination of (note that cursor line starts from 0 and selection width can be negative)

<< Get Cursor Line;
<< Get Cursor Position;
<< Get Selection Width;
<< Get Line Text;
<< Get Lines;

 

-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: Get selected text in Script Box

I think you can do it (in basic cases) with combination of (note that cursor line starts from 0 and selection width can be negative)

<< Get Cursor Line;
<< Get Cursor Position;
<< Get Selection Width;
<< Get Line Text;
<< Get Lines;

 

-Jarmo
MathStatChem
Level VII

Re: Get selected text in Script Box

Thanks.  Alas, this is only in JMP 19 and I only have JMP 18.  

jthi
Super User

Re: Get selected text in Script Box

Yeah, JMP18 is more limited. When I created add-in for JSL Snippets (was "long" before JMP19 released) I had to use workaround in which I inputted specific string into the script box and then I would look for it and replace it with the snippet.

-Jarmo

Recommended Articles