我有一个将 XLSX 转换为 XLS 的 Applescript。我可以从 Google 团队云端硬盘(通过虚拟云端硬盘)获取文件,将其转换并保存到我的桌面。当我尝试将其保存到 Google Team Drive 上的“Out”文件夹时,我收到错误消息。
我相信我的输出路径不正确。我尝试了不同的方法来到达路径,但没有运气。
工作代码保存到桌面:
set {year:y, month:m, day:d, time:t} to (current date)
set today to (m as number) & d & y
set TSCfilein to "Volumes:GoogleDrive:Team Drives:Sales:Customer Service:Inventory Feeds:TSC:In:TSC_Master.xlsx"
set TSCfileout to (path to desktop as text) & "TSC" & today & ".xls" as string
tell application "Microsoft Excel"
activate
open file TSCfilein
tell workbook 1
tell sheet 1
save active workbook in TSCfileout as Excel98to2004 file format
end tell
close without saving
end tell
end tell
将 set TSCfileout 更改为以下内容会导致错误:
set TSCfileout to "Volumes:Google Drive:Team Drives:Sales:Customer Service:Inventory Feeds:TSC:Out" & "TSC" & today & ".xls" as string
预期结果是保存文件 Google Team Drive 文件夹。
错误:
“Microsoft Excel 出现错误:工作簿 1 的工作表 1 的活动工作簿不理解“保存”消息。” 当我尝试指向输出文件位置时。