<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can simulate mouse operation through JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284791#M55008</link>
    <description>&lt;UL&gt;&lt;LI&gt;&lt;P class="src"&gt;How can I use JSL to get CPU usage?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;Thanks!&lt;/LI&gt;&lt;LI&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE class=" language-jsl"&gt;vVBA&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Set objProc = GetObject("winmgmts:\\.\root\cimv2:win32_processor='cpu0'"): cpu = objProc.LoadPercentage&lt;/CODE&gt;&lt;/PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Sat, 08 Aug 2020 14:34:24 GMT</pubDate>
    <dc:creator>lwx228</dc:creator>
    <dc:date>2020-08-08T14:34:24Z</dc:date>
    <item>
      <title>How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284667#M54989</link>
      <description>&lt;P&gt;For example, I want to simulate mouse operation through JSL:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. Simulate moving cursor: move the cursor to the specified position: for example, x=180;Y = 380;&lt;BR /&gt;2. Left click: Left click and click the "Go" button.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-08-07_16-49.png" style="width: 601px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26071i3B5B8FF09DB93CAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-08-07_16-49.png" alt="2020-08-07_16-49.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:34:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284667#M54989</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2023-06-09T23:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284669#M54990</link>
      <description>&lt;P&gt;VBA&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Public Declare PtrSafe Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long&lt;BR /&gt;Public Declare PtrSafe Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long&lt;BR /&gt;Public Const MouseEventf_LeftDown = &amp;amp;H2 
 Public Const MouseEventf_LeftUp = &amp;amp;H4 
 Type POINTAPI
     x As Long
     y As Long
 End Type
 Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
 Sub click()
     SetCursorPos 180, 380
     For i = 1 To 1 
         mouse_event MouseEventf_LeftDown, 0, 0, 0, 0
         mouse_event MouseEventf_LeftUp, 0, 0, 0, 0
     Next
 End Sub&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Aug 2020 09:03:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284669#M54990</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-08-07T09:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284757#M55001</link>
      <description>&lt;P&gt;You can click the button like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=open("$sample_data/big class.jmp");
p = dt&amp;lt;&amp;lt;Partition(
	Y( :age ),
	X( :height, :weight ),
	Validation Portion( 0.25 ),
	Informative Missing( 1 )
);
(report(p)&amp;lt;&amp;lt;xpath("//ButtonBox[@title = 'Go']"))&amp;lt;&amp;lt;click;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Why do you want to move the mouse cursor? There are things beside buttons you might want to click, but there are probably better ways to automate than writing code to move the mouse. Also, people hate it when the mouse moves by itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 17:13:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284757#M55001</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-08-07T17:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284780#M55005</link>
      <description>Thank Craige!&lt;BR /&gt;&lt;BR /&gt;The original JMP could be implemented this way. I learned new skills.</description>
      <pubDate>Fri, 07 Aug 2020 22:15:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284780#M55005</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-08-07T22:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284788#M55006</link>
      <description>Continue to ask more unusual questions: I am now using VBA of Excel to realize various loop operations of different files by JMP by monitoring CPU utilization and controlling mouse movement and clicking. My main goal was to get the Split effect of the decision tree by clicking the "go" button, not through JSL's "Split Best(1000)". I now want to do this without VBA and instead use JSL. Now I need to implement JSL to get the CPU usage.</description>
      <pubDate>Sat, 08 Aug 2020 13:53:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284788#M55006</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-08-08T13:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284790#M55007</link>
      <description>&lt;P&gt;Specifically, all JMP files of a path are divided into decision trees, and the operation time of each file decision tree is different.Let's say the time is between 30 and 60 minutes.&lt;/P&gt;&lt;P&gt;Therefore, JSL should be designed to click the "Go" button for 30 minutes and test the CPU utilization rate every 5 minutes.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If the CPU utilization rate is less than 5%, operation d0&amp;lt;&amp;lt;Run Script("B") should be carried out;&lt;BR /&gt;otherwise, the loop should continue for 5 minutes and then test the CPU utilization rate until the decision tree segmentation is completed.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d0 = Current Data Table();
dir = "c:\1\";
Fs = Files In Directory( dir );
For( d = 1, d &amp;lt;= N Items( fs ), d++,
	dt = Open( dir || fs[d] );

	p = dt &amp;lt;&amp;lt; Partition(
		Y( :Y ),
		X( :X1, :X2 ),
		Validation Portion( 0.25 ),
		Informative Missing( 1 )
	);
	(Report( p ) &amp;lt;&amp;lt; xpath( "//ButtonBox[@title = 'Go']" )) &amp;lt;&amp;lt; click;


	For( j = 1, j &amp;lt;= 6, j++,
		cpu = ……;
		If( cpu &amp;lt; 0.05,
			d0 &amp;lt;&amp;lt; Run Script( "B" ),
			Wait( 300 )//Does this wait affect the decision tree?
		);
	);
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-08-08_22-28.png" style="width: 975px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26102i785441B0DD1AB946/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-08-08_22-28.png" alt="2020-08-08_22-28.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Aug 2020 14:29:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284790#M55007</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-08-08T14:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284791#M55008</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;P class="src"&gt;How can I use JSL to get CPU usage?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;Thanks!&lt;/LI&gt;&lt;LI&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE class=" language-jsl"&gt;vVBA&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Set objProc = GetObject("winmgmts:\\.\root\cimv2:win32_processor='cpu0'"): cpu = objProc.LoadPercentage&lt;/CODE&gt;&lt;/PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sat, 08 Aug 2020 14:34:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284791#M55008</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-08-08T14:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284878#M55009</link>
      <description>&lt;P&gt;I don't know about getting CPU usage. As far as I know JMP doesn't have any tool do to that directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you don't need to simulate a click on the Go button because JSL already has a Go message for the Partition platform.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-08-08_19-18-09.380.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26140iAD7044720DB761DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2020-08-08_19-18-09.380.png" alt="2020-08-08_19-18-09.380.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 08 Aug 2020 23:21:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284878#M55009</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2020-08-08T23:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284880#M55010</link>
      <description>&lt;P&gt;Thank Jeff!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My goal is to wait until the decision tree operation is complete before running the following script.&lt;BR /&gt;Does JMP have functionality in place for this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-08-09_08-13.png" style="width: 798px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26141i3CC8026259FCE943/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-08-09_08-13.png" alt="2020-08-09_08-13.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Aug 2020 00:19:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284880#M55010</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-08-09T00:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284881#M55011</link>
      <description>&lt;P&gt;I think JMP runs the GO button on the main thread, preventing any other activity on the main thread until the split is finished.&amp;nbsp; Can you share an example?&lt;/P&gt;</description>
      <pubDate>Sun, 09 Aug 2020 00:53:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284881#M55011</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-08-09T00:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can simulate mouse operation through JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284886#M55013</link>
      <description>Thank Craige!As you said,"preventing any other activity on the main thread until the split is finished".&lt;BR /&gt;&lt;BR /&gt;I used VBA to control the collaboration between the Q language and JMP.&lt;BR /&gt;&lt;BR /&gt;Now it's easy to just use JMP.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Sun, 09 Aug 2020 02:33:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-simulate-mouse-operation-through-JSL/m-p/284886#M55013</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2020-08-09T02:33:40Z</dc:date>
    </item>
  </channel>
</rss>

