精華區beta EzHotKey 關於我們 聯絡資訊
修改自上一篇 加上利用ControlGet的功能得到檔案名 就能得到完整路徑了 #F:: ;這邊其實這樣寫就可以直接取得active視窗的資訊了 WinGetText, text, A ;取得路徑 Loop, Parse, text, `r`n { if ( A_Index = 1 ) { path = %A_LoopField% break } } ;取得檔名 ControlGet, List, List, Selected, SysListView321, A /* ControlGet指令如下 ControlGet, OutputVar, Cmd [, Value, Control, WinTitle, WinText, ExcludeTitle, ExcludeText] 第一個List是輸出變數,第二個List是表示要取出list這種control的內容 Selected表示只取出選中項目的內容,SysListView321是explorer的檔案列表 A表示active視窗 */ Loop, Parse, List, %A_Tab% if ( A_Index = 1 ) { filename = %A_LoopField% break } ;合體 path = %path%\%filename% ;把\\換成\ StringReplace, path, path, \\ , \, All ;完成 Msgbox, %path% return -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.82.76
VElysian:推推~~ ^_^ 07/27 22:03