sabrogden / Ditto

Ditto is an extension to the Windows Clipboard. You copy something to the Clipboard and Ditto takes what you copied and stores it in a database to retrieve at a later time.
https://ditto-cp.sourceforge.io/
3.93k stars 208 forks source link

usage request #694

Open wethecom opened 4 months ago

wethecom commented 4 months ago

im not 100% fimalar with your app becuase i cant use it based on the last post i made, 

but i would like the option to beable to paste text in the clipboard to a file

and the same functionality to paste images to a file

below is a simple powershell script that does this

im not set up for CPP or i would make it my self

Add-Type -AssemblyName System.Windows.Forms 

Add-Type -AssemblyName 

System.Drawing $clipboard = [System.Windows.Forms.Clipboard]::GetDataObject() if ($clipboard.GetDataPresent([System.Windows.Forms.DataFormats]::Bitmap)) { $image = $clipboard.GetData([System.Windows.Forms.DataFormats]::Bitmap) $image.Save("clipboard_image.png", [System.Drawing.Imaging.ImageFormat]::Png) Write-Output "Image saved as clipboard_image.png" } elseif ($clipboard.GetDataPresent([System.Windows.Forms.DataFormats]::Text)) { $text = $clipboard.GetData([System.Windows.Forms.DataFormats]::Text) Set-Content -Path "clipboard_text.txt" -Value $text Write-Output "Text saved as clipboard_text.txt" } else { Write-Output "Clipboard does not contain an image or text." }