<?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: Have a new window appear next to current mouse location in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466437#M71023</link>
    <description>&lt;P&gt;thanks for the suggested code.&amp;nbsp; I'm not familiar with powershell so I just grabbed your code and ran it and got this in the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Add-Type : Cannot add type. Definition of new types is not supported in this language mode.&lt;BR /&gt;At line:1 char:1&lt;BR /&gt;+ Add-Type -AssemblyName System.Windows.Forms&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : PermissionDenied: (:) [Add-Type], PSNotSupportedException&lt;BR /&gt;+ FullyQualifiedErrorId : CannotDefineNewType,Microsoft.PowerShell.Commands.AddTypeCommand&lt;BR /&gt;&lt;BR /&gt;Unable to find type [System.Windows.Forms.Cursor].&lt;BR /&gt;At line:2 char:6&lt;BR /&gt;+ $X = [System.Windows.Forms.Cursor]::Position.X&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Windows.Forms.Cursor:TypeName) [], RuntimeException&lt;BR /&gt;+ FullyQualifiedErrorId : TypeNotFound&lt;BR /&gt;&lt;BR /&gt;Unable to find type [System.Windows.Forms.Cursor].&lt;BR /&gt;At line:3 char:6&lt;BR /&gt;+ $Y = [System.Windows.Forms.Cursor]::Position.Y&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Windows.Forms.Cursor:TypeName) [], RuntimeException&lt;BR /&gt;+ FullyQualifiedErrorId : TypeNotFound&lt;BR /&gt;&lt;BR /&gt;X: | Y:"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't see anything returned that I could use for the position of the mouse.&amp;nbsp; Am I missing something or do I need to do something to set up powershell?&amp;nbsp; I'm using two monitors and running the script on my primary one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 01:32:51 GMT</pubDate>
    <dc:creator>shampton82</dc:creator>
    <dc:date>2022-03-03T01:32:51Z</dc:date>
    <item>
      <title>Have a new window appear next to current mouse location</title>
      <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466070#M70987</link>
      <description>&lt;P&gt;Is it possible through JSL to get the location of the mouse and then have a new window open to the right of it?&amp;nbsp; It seems straight forward enough but looking through the scripting help I couldn't figure it out.&amp;nbsp; thanks for any pointers!&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:11:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466070#M70987</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2023-06-09T18:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Have a new window appear next to current mouse location</title>
      <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466125#M70993</link>
      <description>&lt;P&gt;The only way that I believe that one can get the mouse position from anywhere on the screen, would be through either the JMP extension into R or Python.&amp;nbsp; Once the mouse position is returned, then JSL can create the New Window(), and then Move Window() to the desired position.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 10:30:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466125#M70993</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-03-02T10:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Have a new window appear next to current mouse location</title>
      <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466181#M70998</link>
      <description>&lt;P&gt;If you are using windows you could use powershell. Here is one example (might be good idea to return also number of display and not just coordinates):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

powershell_variables = Eval Insert("\[Add-Type -AssemblyName System.Windows.Forms
$X = [System.Windows.Forms.Cursor]::Position.X
$Y = [System.Windows.Forms.Cursor]::Position.Y
Write-Output "X: $X | Y: $Y"]\", "¤");

//fix quotes and cleanup
quote="\!"";
escapedquote = "\!\\!"";	
Substitute Into(powershell_variables, quote, escapedquote);

r = Trim Whitespace(Run Program(
	Executable( "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" ),
	Options({powershell_variables}),
	Read Function("text")
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have usually managed these by opening new windows on top of current window() and then calculated the location based on that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 13:19:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466181#M70998</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-03-02T13:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Have a new window appear next to current mouse location</title>
      <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466437#M71023</link>
      <description>&lt;P&gt;thanks for the suggested code.&amp;nbsp; I'm not familiar with powershell so I just grabbed your code and ran it and got this in the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Add-Type : Cannot add type. Definition of new types is not supported in this language mode.&lt;BR /&gt;At line:1 char:1&lt;BR /&gt;+ Add-Type -AssemblyName System.Windows.Forms&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : PermissionDenied: (:) [Add-Type], PSNotSupportedException&lt;BR /&gt;+ FullyQualifiedErrorId : CannotDefineNewType,Microsoft.PowerShell.Commands.AddTypeCommand&lt;BR /&gt;&lt;BR /&gt;Unable to find type [System.Windows.Forms.Cursor].&lt;BR /&gt;At line:2 char:6&lt;BR /&gt;+ $X = [System.Windows.Forms.Cursor]::Position.X&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Windows.Forms.Cursor:TypeName) [], RuntimeException&lt;BR /&gt;+ FullyQualifiedErrorId : TypeNotFound&lt;BR /&gt;&lt;BR /&gt;Unable to find type [System.Windows.Forms.Cursor].&lt;BR /&gt;At line:3 char:6&lt;BR /&gt;+ $Y = [System.Windows.Forms.Cursor]::Position.Y&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Windows.Forms.Cursor:TypeName) [], RuntimeException&lt;BR /&gt;+ FullyQualifiedErrorId : TypeNotFound&lt;BR /&gt;&lt;BR /&gt;X: | Y:"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't see anything returned that I could use for the position of the mouse.&amp;nbsp; Am I missing something or do I need to do something to set up powershell?&amp;nbsp; I'm using two monitors and running the script on my primary one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 01:32:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466437#M71023</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2022-03-03T01:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Have a new window appear next to current mouse location</title>
      <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466441#M71025</link>
      <description>&lt;P&gt;What is your version of JMP?&lt;/P&gt;
&lt;P&gt;Are you running Windows 10?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 01:42:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466441#M71025</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-03-03T01:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Have a new window appear next to current mouse location</title>
      <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466462#M71027</link>
      <description>&lt;P&gt;JMP Pro 16.0, Windows 10 Enterprise version 10.0.19044&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 02:44:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466462#M71027</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2022-03-03T02:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Have a new window appear next to current mouse location</title>
      <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466466#M71028</link>
      <description>&lt;P&gt;I'm not too familiar with powershell either, I only use it when I have to. You could try running that command&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Add-Type -AssemblyName System.Windows.Forms
$X = [System.Windows.Forms.Cursor]::Position.X
$Y = [System.Windows.Forms.Cursor]::Position.Y
Write-Output "X: $X | Y: $Y"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;directly in powershell and see if you get the same error. This is when I run powershell through commandline:&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="jthi_0-1646288103448.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/40460iDC236E8C7A7803A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1646288103448.png" alt="jthi_0-1646288103448.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I run the command by windows searching for powershell it seems to return similar error:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1646288388895.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/40461iCD51886FE8790237/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1646288388895.png" alt="jthi_1-1646288388895.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;but if I run it again after the errors, it seems to return either string without coordinates or coordinates as it should.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 06:46:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466466#M71028</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-03-03T06:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Have a new window appear next to current mouse location</title>
      <link>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466727#M71054</link>
      <description>&lt;P&gt;I could get it to work through Windows Powershell ICE but not Windows Powershell, don't know what that means but just throwing it out there in case anyone else does!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 18:16:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Have-a-new-window-appear-next-to-current-mouse-location/m-p/466727#M71054</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2022-03-03T18:16:51Z</dc:date>
    </item>
  </channel>
</rss>

