clipboard(剪貼板)
在系統剪貼板上執行復制和粘貼操作。
await eagle.clipboard.writeText('Example string');
console.log(await eagle.clipboard.readText());方法
clear()
清除剪貼板內容。
eagle.clipboard.writeText('Example string');
eagle.clipboard.clear();
console.log(eagle.clipboard.readText()); // undefinedhas(format)
當前剪貼板內容是否包含指定的 format
formatstring - 指定格式返回 boolean - 是否包含指定格式
writeText(text)
將 text 作為純文字寫入剪貼板。
textstring - 欲寫入文字
readText()
獲取前當剪貼板的純文字內。
返回 string
writeBuffer(format, buffer)
將 buffer 作為 format 類型寫入剪貼板。
formatstring - 剪貼板格式bufferBuffer - 欲寫入內容之 Buffer 格式
readBuffer(format)
從剪貼板中讀取 format 類型的內容。
返回 Buffer
writeImage(image)
將 image 寫入剪貼板。
imageNativeImage - 欲寫入剪貼板圖片
readImage()
從剪貼板中讀取圖片格式內容。
返回 NativeImage
writeHTML(markup)
將 markup 作為 HTML 格式寫入剪貼板。
markupstring
readHTML()
從剪貼板中讀取 HTML 格式內容。
返回 string
copyFiles(paths)
將指定檔案複製到剪貼板,支援檔案管理器粘貼。
pathsstrings[] - 欲複製到剪貼板的檔案。
Last updated