在當前滑鼠位置旁邊出現一個新視窗是否可以透過JSL取得滑鼠的位置,然後在其右側開啟一個新視窗?它看起來很簡單,但查看腳本幫助我無法弄清楚。感謝您的指點!
史蒂夫
自動化和腳本編寫回覆:在目前滑鼠位置旁邊出現一個新視窗我可以讓它通過 Windows Powershell ICE 工作,但不能通過 Windows Powershell,我不知道這意味著什麼,但只是把它扔在那裡以防其他人這樣做!
回覆:在目前滑鼠位置旁邊出現一個新視窗我對powershell也不太熟悉,我只在必要時使用它。 你可以嘗試運行該命令
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"
直接在 powershell 中查看是否出現相同的錯誤。 這是我透過命令列運行 powershell 時的情況:

如果我透過 Windows 搜尋 powershell 運行命令,它似乎會返回類似的錯誤:

但如果我在錯誤發生後再次運行它,它似乎會傳回沒有座標的字串或應有的座標。
回覆:在目前滑鼠位置旁邊出現一個新視窗JMP Pro 16.0、Windows 10 企業版 10.0.19044
回覆:在目前滑鼠位置旁邊出現一個新視窗您的 JMP 版本是什麼?
您執行的是 Windows 10 嗎?
回覆:在目前滑鼠位置旁邊出現一個新視窗感謝您建議的代碼。我不熟悉 powershell 所以我只是抓住你的程式碼並運行它並在日誌中得到這個:
“新增類型:無法新增類型。 此語言模式不支援新類型的定義。
行:1 字元:1
+ 新增類型 -AssemblyName System.Windows.Forms
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [新增型別],PSNotSupportedException
+FullyQualifiedErrorId:無法定義NewType,Microsoft.PowerShell.Commands.AddTypeCommand
無法找到類型 [System.Windows.Forms.Cursor]。
行:2 字元:6
+ $X = [System.Windows.Forms.Cursor]::Position.X
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Windows.Forms.Cursor:TypeName) [], RuntimeException
+ FullQualifiedErrorId:類型未找到
無法找到類型 [System.Windows.Forms.Cursor]。
行:3 字元:6
+ $Y = [System.Windows.Forms.Cursor]::Position.Y
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Windows.Forms.Cursor:TypeName) [], RuntimeException
+ FullQualifiedErrorId:類型未找到
X: |是:”
我沒有看到任何可以用於滑鼠位置的返回內容。我是否遺漏了什麼或我需要做些什麼來設定 powershell?我使用兩台顯示器並在主顯示器上運行腳本。
史蒂夫
回覆:在目前滑鼠位置旁邊出現一個新視窗如果您使用的是 Windows,則可以使用 powershell。 這是一個範例(返回顯示數量而不僅僅是座標可能是個好主意):
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")
));
我通常會透過在當前 window() 之上打開新窗口來管理這些窗口,然後根據該窗口計算位置。
回覆:在目前滑鼠位置旁邊出現一個新視窗我認為可以從螢幕上的任何位置獲取滑鼠位置的唯一方法是透過 R 或 Python 中的 JMP 擴展。一旦回到滑鼠位置,JSL 就可以建立 New Window(),然後 Move Window() 到所需位置。