Guest User

Autohotkey send multi-lines

a guest
Oct 13th, 2025
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 0.64 KB | Software | 0 0
  1. ; AutoHotKey V1
  2.  
  3. ::text1::   ; 熱字串:輸入 text1 加上任意終止符(空格/Enter/.) 自動轉換輸出
  4. (
  5. Hot
  6. String
  7. )
  8. return
  9.  
  10. F1::        ; 逐字輸出
  11. SendInput,
  12. (
  13. Line1
  14. Line2
  15. )
  16. return
  17.  
  18. F2::            ; 直接貼上
  19. clipboard =     ; 寫入剪貼簿
  20. (
  21. Line3
  22. Line4
  23. )
  24. ClipWait        ; 等待剪貼簿寫入
  25. SendInput ^v    ; ctrl+v 貼上
  26. return
  27.  
  28. F3::
  29. FileRead, OutputVar, %A_ScriptDir%\test.txt ; 讀取文字檔
  30. SendInput %OutputVar%                       ; 逐字輸出
  31. return
  32.  
  33. F4::
  34. FileRead, clipboard, %A_ScriptDir%\test.txt ; 讀取文字檔,寫入剪貼簿
  35. ClipWait                                    ; 等待剪貼簿寫入
  36. SendInput ^v                                ; ctrl+v 貼上
  37. return
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment