我正在处理我的第一个AppleScript(2.5),并且似乎无法解决我的问题。使用applescript将文件导出为pdf
我试图打开文件夹中的每个降价文件并导出为PDF。用指定的应用程序打开文件,但在导出前我得到'变量PDF未定义'。
我已经尝试了四到五套不同的命令,从保存命令的排列组合中尝试使用“导出”,但这种形式似乎是最接近成功的。 (每当我使用出口我得到“预期线等的结束,但发现标识”,字“出口”高亮)
我明白任何见解
tell application "Finder"
set sourceFolder to "Path:To:SourceFolder"
set MDFiles to files of folder sourceFolder whose name extension is "md"
end tell
repeat with f in MDFiles
set filePath to f as text
set newFilePath to (text 1 thru -2 of filePath) & "pdf"
tell application "MacDown"
open f
save f in file newFilePath as PDF
close f saving no
end tell
end repeat
查看“MacDown”字典来确定'save'命令提供的参数。 – vadian
谢谢!我现在要google怎么做:) –
在脚本编辑器中按⇧⌘O并在列表中选择应用程序。 – vadian