Home Forums General XMetaL Discussion copy paste a clipboard file Reply To: copy paste a clipboard file

Derek Read

Reply to: copy paste a clipboard file

If the path to the image is on the clipboard then you can use Windows File System Object to move or copy that file to the location you need it to be.

You can use the standard Windows ClipBrd.exe tool (aka: ClipBook Viewer) to see what formats are on the clipboard. You can then use XMetaL's clipboard API to get the path from the text on the clipboard (assuming it is there).

If what is on the clipboard is the actual bitmap image data (user pressed “print screen” or perhaps copied something from a graphics application) then you will need to use 3rd party software or write your own (possibly as a DLL) to save what is on the clipboard to a file. The solution will probably very much depend on which software you end up using and your exact needs (probably which image formats you wish to support). I suspect it would be quite tricky to implement this type of thing. If you wish to implement your own solution using a DLL then you could end up creating an event called On_Drop_ where the latter portion is defined by Application.AcceptDropFormat or ActiveDocument.AcceptDropFormat. There is limited documentation for this in the Programmers Guide under the topic “when objects are dropped”. It is limited because we do not have an example of a DLL that can handle a specific clipboard format and no guidance as to how you would write one. You might get started with a search like this: http://www.google.com/search?q=dll+clipboard+format