// 找到與crop-2345最相似位置(信心程度95%)後點擊相對位移(x,y)並等待500ms後繼續下個指令, 找到後立即移動滑鼠游標無需軌跡 (instant: true)
await api.clickCrop('crop-2345', x, y, {confidence:0.95, wait:500, instant: true})
// 找到與crop-3456最相似位置(信心程度95%)後將滑鼠游標移到相對位移(x,y)並等待500ms後再繼續下個指令
await api.moveToCrop('crop-3456', x, y, {confidence:0.95, wait:500})
// 從found3(上方範例)相對位移(x,y)擷取長寬wxh螢幕截圖做OCR
// searchLine為搜尋文字結果的正規表達式,與下方moveCursor合併使用
// moveCursor為布林值,代表是否將滑鼠游標移至找到的searchLine在螢幕上的中心位置
// language為OCR的辨識語言: 'eng','chi_tra'
let result = await api.captureToOcr(found2, x, y, w, h, searchLine, moveCursor, language)
console.log(result.text)
// 貼上文字快捷鍵
await api.pasteText('hello')
// 讀寫剪貼簿同步函式
api.clipboard.writeText('hello')
console.log(api.clipboard.readText())
// 讀CSV檔API,分隔符號為逗點,讀取表頭須從檔頭略過0列
let rows = await api.readCSV('input.csv', ',', 0)
// 寫CSV檔API,表頭依序為name,age
await api.writeCSV('output.csv', [{name:'Alice',age:20},{name:'Bob',age:25}], ['name','age'])
// 等待5秒鐘
await api.sleep(5000)
// 執行其他技能
await api.run('bed383cd-ec5b-497e-ae4d-b9ad906e0abe')
// 開啟工作資料夾檔案
await api.shell.openPath('output.csv')
// 開啟任意檔案
await api.shell.openPath('/Users/emily/Desktop/input.xlsx')
// 開啟檔案總管並選取檔案
await api.shell.showItemInFolder('/Users/emily/Desktop/input.xlsx')
// 將檔案移至資源回收桶
await api.shell.trashItem('/Users/emily/Desktop/input.xlsx')
// 開啟網頁連結
await api.shell.openExternal('https://google.com')
// 執行 PowerShell 腳本
let result1 = await api.powerShell('Get-Process')
// 執行 PowerShell PS1 檔案腳本
let result2 = await api.powerShell('./myscript.ps1')