看板 EzHotKey 關於我們 聯絡資訊
※ 引述《prejv ( )》之銘言: : 我想要用loop來進行重複動作 : 1.用Alt+s開啟程式中對話視窗A : key in程式要吃的檔案路徑及檔名(filename) : 關閉對話視窗 : 2.點選對話視窗B : key in 轉換出的檔案路徑及filename : 此處的filename動作1相同只是差別在於附檔名 : 關閉對話視窗 : 想要請問上述的動作要進行重複,而每一次的重複filename就要+1 : 例如: 重複2次時 第一次key in filename=ABC1 : 第二次filename=ABC2 : 程式碼要怎麼更改??謝謝 : 以下是我寫好的部份程式碼~ number = 1 : Loop %BT% ;%BT%為重複次數 : { : Send, {ALTDOWN}s{ALTUP} : WinWait, Setup, : IfWinNotActive, Setup, , WinActivate, Setup, : WinWaitActive, Setup, : Send, {TAB 7} : Send, %path% : Send, {TAB 3}{ENTER} ;關閉對話視窗A : MouseClick, left, 212, 75 ;開啟對話視窗B : Send, %A_WorkingDir%\Report\%filename_no_ext%%number%.txt : MouseClick, left, 77, 370 ;轉檔 : sleep,5000 : MouseClick, left, 178, 370 ;關閉對話視窗B number := number + 1 : } ─────────────────────────────────── 說明: 我們都知道要指定一段文字給變數要用等號 (=): string = Hello world!! number = 100 但是要將運算過後的值指定給變數必須要用 (:=): sum3 := 1+2+3 ;sum3 = 6 num = 99 numAdd := num + 1 ;numAdd = 100 至於單純的變數內容連結就直接這樣寫就好了: string1 = Hello string2 = world string3 = !! string = %string1% %string2%%string3% └ 空格 結果是 (Hello world!!) └ 空格 寫完了,希望有幫助。 ^__^ -- 主動是機會的誘餌 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.130.208.20 ※ 編輯: VElysian 來自: 140.130.208.20 (09/20 14:21) ※ 編輯: VElysian 來自: 140.130.208.20 (09/20 14:22)
hyster11:每次都覺得版主是佛心來的... 09/23 00:07
b2rex:版主是神..... 09/23 12:18
bizarre0310:什麼,這是什麼,似乎很棒又似乎… 01/06 01:16