⚠️注意:适用于macOS10.12、PowerPoint15.15以后版本。
macOS系统下使用Automator应用,编写一段简单的Workflow程序,即可实现Finder内的PPT文件一键转化为PDF。代码来源于国外论坛,但是实际使用的时候并非真正的“一键转换”,需要打开Automator应用、允许文件夹适用权限等等。这里提供自用的修改版本,十分方便。
1、编写Applescript脚本:
打开Automator应用,新建Workflow文件,编写代码如下,完成后保存:
on run {input, parameters}
tell application "PowerPoint"
launch
repeat with i in input
open i
set pdfPath to my makeNewPath(i)
save active presentation in pdfPath as save as PDF
close active presentation saving no
end repeat
quit
end tell
end run
on makeNewPath(f)
set t to f as string
if t ends with ".pptx" then
return (text 1 thru -5 of t) & "pdf"
else
return t & ".pdf"
end if
end makeNewPath
2、导出为Service:
编写完后点击保存,然后在顶部菜单栏点击 File - Convert To... - Services,将Workflow文件导出为系统服务,重命名该服务名称,会自动添加到系统右键菜单。
3、使用:
只需要选中PPT文件,点击PPT2PDF即可,PowerPoint将会自动打开,自动转换并保存PDF文件至相同文件夹,然后自动退出。