0
我试图自动执行MS PowerPoint中的转换(版本15.30)2016文件使用AppleScript。我有以下脚本:使用AppleScript打开懂MS PowerPoint 2016文件
on savePowerPointAsPDF(documentPath, PDFPath)
tell application "Microsoft PowerPoint"
open alias documentPath
tell active presentation
delay 1
save in PDFPath as save as PDF
end tell
quit
end tell
end savePowerPointAsPDF
savePowerPointAsPDF("Macintosh HD:Users:xx:Dropbox:zz yy:file.pptx", "Macintosh HD:Users:xx:Dropbox:zz yy:file.pdf")
这个脚本工作正常,除了:
- 我第一次运行它,我得到了“授予访问权限”对话框。
- 所有我运行它的时候,我得到一个对话框,上面写着:“文件名已被移动或删除”
当我点击通过所有这些对话框,它工作正常。我尝试过使用POSIX文件名,但没有成功。我无法获得一个有足够空间的路径来工作。
下面用Excel工作了解决第一个问题,但似乎并没有使用PowerPoint的工作:
set tFile to (POSIX path of documentPath) as POSIX file
综上所述,我只是想使用的AppleScript打开使用PowerPoint 2016的PowerPoint文件Mac。的路径和文件名可以包含空格和其他的MacOS允许非字母数字字符在其中。
任何建议如何解决这些问题呢?
这个伟大的工程,但,我有添加在createEmptyFile功能的“做壳”和“返回”语句之间的“延迟1”,否则,有时会工作,有时没有。非常感谢! – user1092808