I'm searching for a way to do that.
Using ArsClip's Clipboard Bar, I see that when I select a file o Windows Explorer and copy it, its full path is stored on clipboard.
If I keep selecting Windows Explorer and paste, that file is copied to current foler, ok.
If I go to Notepad2 (or any text editor) and paste, the usual behavior is nothing happen. I'd like the file path to be pasted as text.
I'm trying to implement this feature using AutoHotKey. I'd need to:
1) intercept paste command, not just Ctrl+V keystroke
2) verify if the pasting target is a text editor and not a file manager
3) when that's the case, I'd need to retrieve the file path from clipboard, which ArsClip is able to do
4) then edit clipbard to place that string into it, so that the paste command will write the string to the target.
I don't mind to lose the file reference. It means that I don't mind if, after running this routine, Windows Explorer won't copy the file anymore.
Any idea how to do it?
Based on the answer of user3419297 I made this code:
~F9:: ; run when F9 is pressed, ~ makes any other feature still trigger
if GetKeyState("ScrollLock", "T") ; only run if ScrollLock is active, easy way to quickly suspend the feature
&& WinActive("ahk_class CabinetWClass") ; only run when WinExplorer is active window
{
clipboard := "" ; empty clipboard
Send, ^c ; copy the selected file
ClipWait, 1 ; wait for the clipboard to contain data
if (!ErrorLevel) ; If NOT ErrorLevel clipwait found data on the clipboard
clipboard := clipboard ; convert to text (= copy the path)
}
return