mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-14 22:54:32 +08:00
模拟操作添加屏幕找图(Mac)
This commit is contained in:
@@ -157,6 +157,21 @@ const quickcommand = {
|
||||
writeClipboard: function (text) {
|
||||
electron.clipboard.writeText(text.toString());
|
||||
},
|
||||
|
||||
readClipboardImage: function () {
|
||||
// 从剪贴板获取图片
|
||||
const image = electron.clipboard.readImage();
|
||||
if (!image.isEmpty()) {
|
||||
return image.toDataURL();
|
||||
}
|
||||
|
||||
// 尝试获取文本(可能是base64格式的图片)
|
||||
const clipboardText = electron.clipboard.readText();
|
||||
if (clipboardText && clipboardText.startsWith("data:image")) {
|
||||
return clipboardText;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
};
|
||||
|
||||
if (process.platform === "win32") {
|
||||
|
||||
Reference in New Issue
Block a user