import { pasteboard } from '@kit.BasicServicesKit';
// 获取系统剪贴板对象
let systemPasteboard: pasteboard.SystemPasteboard = pasteboard.getSystemPasteboard();
// 将纯文本数据写入系统剪贴板
let text = "This is data"
let pasteData: pasteboard.PasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, text);
systemPasteboard.setData(pasteData)