Copy file names selected in File Explorer with AutoHotkey

The following AutoHotkey script will copy the file names selected in File Explorer.

Useful to fill quotes, invoices and project control sheets.

Just press the F12 key!

Macro explained posted in https://www.gonduana.com/como-copiar-los-nombres-de-archivos-con-autohotkey (in plain Spanish, sorry)

Enjoy!

; Copy file names selected in File Explorer
; www.gonduana.com/como-copiar-los-nombres-de-archivos-con-autohotkey
#IfWinActive ahk_exe explorer.exe
F12 up::
    ControlGetFocus, myControl, A
    If (myControl = "DirectUIHWND3")
    {
        clipboard =
        SendInput, {Control Down}c{Control Up}
        ClipWait, 0
        Clipboard := RegExReplace(Clipboard, "m)^.+\\", "")
        Sort, Clipboard
        MsgBox, 64, File names to Clipboard, %Clipboard%
    }
#IfWinActive

Parents Reply
  • Hi ,

    I don’t know Directory Opus, sorry.

    My bet is that there must be a way. At least, it’s worth a try, because there may be a built-in function. If so, you would need to change the first #IfWinActive directive.

    For example, there is a way with File Explorer, not so handy, but it works: Press SHIFT key, then right click, and select Copy as path from the pop-up menu. Now the clipboard's content will be something like this:

    "C:\folder1\document1.DOC"
    "C:\folder1\document2.DOCX"
    "C:\folder1\presentation1.pptx"

    Then it’s just a matter of removing quotes and path.

    What I mean is that there may be something similar in Directory Opus and then it’ll be easy to customise the AutoHotkey script.

Children
No Data