eltos / PasteIntoFile

Paste clipboard data into files and copy file contents directly via hotkey or context menu
MIT License
87 stars 6 forks source link

Feature: Overwrite file with clipboard #13

Closed tfiers closed 1 year ago

tfiers commented 1 year ago

Proposal: A new context menu item when right-clicking on a file[^ctx], named something like "Overwrite with clipboard". Clicking this, PasteIntoFile will look at the extension and name of the original file; delete that file; and write a new file based on your clipboard, with the old name and format.

My use case: I make diagrams in powerpoint[^1], and extract them by pasting as an image. (They are then included in a latex document). Often, I want to tweak a diagram afterwards. Currently, I have to paste the new image with a temporary filename (namely the default datetime); copy the filename of the previous version; delete that version; and rename the new image with the copied filename. With an "overwrite file with clipboard" option in the context menu of the existing file, this would be reduced to one action.

[^ctx]: currently, that context menu already contains "Copy file content" by PasteIntoImage [^1]: yes, a dedicated vector editing program like Inkscape, with built-in export, would be more proper. But using PPT for editing the diagrams is easier atm.


Related:

eltos commented 1 year ago

Excellent proposal, in this case the dialog should probably never be shown (independent of the autosave setting), and the file be directly overwritten without the usual confirmation? Maybe it would be good to move the file to the recycle bin before overwriting, to prevent accidental data loss.

eltos commented 1 year ago

Please have a look at the latest debug build
https://github.com/eltos/PasteIntoFile/suites/9345758906/artifacts/439611436

tfiers commented 1 year ago

Tested it, works beautifully.