Online Documents
繁體中文
繁體中文
  • First Launch Experience
  • How to Train EMILY?
  • Simple Web Automation
  • Web Automation Tools
  • Web Automation Processor
  • User Fill
  • Workspace Script
  • File Exporter
  • File Enumerator
  • EXCEL Processor
  • EXCEL Analyzer
  • EXCEL Writer
  • EXCEL Filler
  • CSV Creator
  • PowerShell
  • PDF Analyzer
  • Mail Sender
  • Mail Reader
  • Exchange Mail Sender
  • Exchange Mail Reader
  • HTTP Analyzer
  • Command Line
  • DOCX Templater
  • SQL Executor
  • Desktop Automation (DA)
  • SFTP
  • JSON API Server
  • Chart
  • DOCX2HTML
  • Folder Processor
  • Google Drive
  • Google Sheets
  • Google OCR
  • Google NLU
  • Azure Form Recognizer
  • Anti-Captcha
  • ChatGPT
  • Gemini
  • Schedule Trigger
  • Mail Trigger
  • File Trigger
  • API Trigger
  • Protect Text
  • Flexibility & Security
  • Announcement
    • Version Releases
    • Third Party Notice
Powered by GitBook
On this page
  • File ID
  • input 物件

Google Drive

存取 Google Drive 中特定資料夾或檔案,需要2.1.20230130以上版本

File ID

指定 Google Drive 資料夾或檔案的 ID,支援 %FILENAME% 文檔變數。

input 物件

為指定 File ID 的 Google Drive 物件。若為資料夾物件,支援 list(), upload(filename), createFolder(foldername), createSpreadsheet(filename) 等非同步函式;若為檔案物件,則支援 download(filename) 非同步函式:

// 指定的 File ID 為資料夾時,列出此資料夾中的所有物件,並下載所有檔案
let items = await input.list()
console.log(items)

// 當物件支援download(filename)函式時,將資料夾的檔案物件下載
for (const item of items) {
  if (item.download) await item.download()
}

// 指定的 File ID 為資料夾時,上傳一個工作資料夾中的檔案
let file = await input.upload('image.jpg')
console.log(file)

// 指定的 File ID 為資料夾時,建立一個名為 'subfolder' 子資料夾
let folder = await input.createFolder('subfolder')
console.log(folder)

// 指定的 File ID 為資料夾時,建立一個 Google Spreadsheet 檔案
let file2 = await input.createSpreadsheet('mysheet')
console.log(file2)

// 指定的 File ID 為檔案時,下載此檔案到工作資料夾
await input.download()
PreviousFolder ProcessorNextGoogle Sheets

Last updated 3 months ago