0
votes

I have tried this but it's not copying the path of the folder containing the script:

If(WinActive("ahk_class ExploreWClass")) 
{ ClipSaved := ClipboardAll
    ; save original clipboard clipboard =                   ; clear
clipboard Send, "%A_WorkingDir%"                ; copy selected folder  
ClipWait, 2             ; wait until the clipboard contains data Sleep,
100 }

Thanks for your help!

P.S: For this, I am using AHK as a bat, not as a hotkey

1

1 Answers

1
votes
 ClipSaved := ClipboardAll   ; Save the entire clipboard to the  variable ClipSaved
 clipboard = %A_ScriptDir%
; ClipWait
; do sth e.g,   ; SendInput, ^v  
Clipboard := ClipSaved   ; Restore the original clipboard

https://autohotkey.com/docs/misc/Clipboard.htm#ClipboardAll