Author Topic: Link to file in clipboard  (Read 17730 times)

Bernd

  • Junior Member
  • **
  • Posts: 13
    • View Profile
Link to file in clipboard
« on: November 22, 2020, 13:56:06 »
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

  • VIP Member
  • *****
  • Posts: 433
  • VERY old Programmer
    • View Profile
Re: Link to file in clipboard
« Reply #1 on: November 22, 2020, 16:47:33 »
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

  • Junior Member
  • **
  • Posts: 13
    • View Profile
Re: Link to file in clipboard
« Reply #2 on: November 22, 2020, 17:19:39 »
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

  • VIP Member
  • *****
  • Posts: 433
  • VERY old Programmer
    • View Profile
Re: Link to file in clipboard
« Reply #3 on: November 23, 2020, 11:05:47 »
Yes - I misunderstood - sorry.

Matthias515566

  • Power Member
  • ****
  • Posts: 323
    • View Profile
Re: Link to file in clipboard
« Reply #4 on: November 26, 2020, 03:12:50 »
i have a good solution for your Problem. Create a new "User Defined Command" and a Keyboard Shortcut to this command.

Code: [Select]
MC.Utils.CreateLink LNKSRC="${targetpath}${sourcefocusname}.lnk" LNKTRG="${focusfilepath}" LNKTYPE=4
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?

« Last Edit: November 26, 2020, 03:17:37 by Matthias515566 »