From this post ages ago: https://umod.org/community/copy-paste/22938-api-endpoint-for-trypastebackfromfile
The functionality I wrote then no longer works since I updated the CopyPaste plugin - not sure what version I had before. Do I need to make some alteration to my code:
CallHook("TryPasteBack", filename, null, args);