Web Automation Processor
簡稱 WAP,是針對不同應用主題設計的自動化模組

// 一筆筆列出所有工作資料夾中的檔案
api.files().forEach((file) => console.log(file))
// 用 lodash.js _.filter() 函式過濾出檔名為 'jpg' 結尾的檔案,
const files = api.files()
console.log(_.filter(files, (file) => file.endsWith('jpg')))
// 讀取工作資料夾中的文字檔 price.txt
console.log(api.read('price.txt'))
// 使用 moment.js 產生自訂格式的日期字串,並寫出文字檔到工作資料夾中
api.write('time.txt', moment().format('HH:mm:ss'))
// 修改工作資料夾中的檔案名稱
api.rename('time.txt', 'currentTime.txt')
// 刪除工作資料夾中的檔案
api.remove('price.txt')最后更新于
这有帮助吗?