The Webkit example has a function that takes a path to an HTML file on your computer (could be updated to take a URL as well) and returns data that can be placed on the clipboard using `the rawclipboardData`:
Code: Select all
put GetWebArchiveDataFromFile("/path/to/my_html.html") into tArchive
lock clipboard
set the rawClipboardData to empty
set the rawClipboardData["com.apple.webarchive"] to tArchive
unlock clipboard
Code: Select all
put GetSerializedRepresentationFromFile("/path/to/my_rtf_file.rtfd") into tSerializedData
lock clipboard
set the rawClipboardData to empty
set the rawClipboardData["com.apple.flat-rtfd"] to tSerializedData
unlock clipboard
Using `the raw clipboardData` you can put both RTFD and the webarchive on the clipboard at the same time.
Code: Select all
...
lock clipboard
set the rawClipboardData to empty
set the rawClipboardData["com.apple.webarchive"] to tArchive
set the rawClipboardData["com.apple.flat-rtfd"] to tSerializedData
unlock clipboard
https://github.com/trevordevore/lc-macos-toolset/