Multi Commander > Script

Link to file in clipboard

(1/1)

Bernd:
I am trying to do the following thing. I copy a file with Ctrl+C (not necessarily in MC); then I navigate to a folder in MC, use a User Defined command (or something else) to create a lnk file to point to the file in the clipboard. But I don't know how to get the path to the file in the clipboard - GetClipboardText() doesn't do it. And I don't know how to create a lnk file pointing to that path.

AlanJB:
The clipboard does not exist as a file system object (like a file or folder) so you cannot link to it.

"The clipboard" is a memory object dynamically created as it is needed.

Bernd:
That‘s a misunderstanding. I don‘t want to link to the clipboard but I want to link to the file at the place where I copied it with Ctrl+C to the clipboard. Very much like you can Ctrl+C in Windows Explorer and then can create a link via the right click menu. Unfortunately it seems, MC can‘t do this out of the box.

AlanJB:
Yes - I misunderstood - sorry.

Matthias515566:
i have a good solution for your Problem. Create a new "User Defined Command" and a Keyboard Shortcut to this command.


--- Code: ---MC.Utils.CreateLink LNKSRC="${targetpath}${sourcefocusname}.lnk" LNKTRG="${focusfilepath}" LNKTYPE=4
--- End code ---

This create a new shortcut in the Target Panel, but this works only for one file, not for multiple files. maybe somebody have a solution for multiple files and folders?

Navigation

[0] Message Index

Go to full version