macOS 实现 PPT 批量转 PDF

温馨提示:本文最后更新于2024-10-12 15:18:26,某些文章具有时效性,若有错误或已失效,请在下方留言

本文主要利用 macOS 的 自动操作 以及 AppleScript 来实现 PPT 批量转 PDF。

PPT转 PDF

AppleScript 的运行脚本

on run {input, parameters}
    set theOutput to {}
    tell application "Microsoft PowerPoint" -- work on version 15.15 or newer
        launch
        set theDial to start up dialog
        set start up dialog to false
        repeat with i in input
            open i
            set pdfPath to my makeNewPath(i)
            save active presentation in pdfPath as save as PDF -- save in same folder
            close active presentation saving no
            set end of theOutput to pdfPath as alias
        end repeat
        set start up dialog to theDial
    end tell
    return theOutput
end run

on makeNewPath(f)
    set t to f as string
    if t ends with ".pptx" then
        return (text 1 thru -6 of t) & ".pdf"
    else
        return (text 1 thru -5 of t) & ".pdf"
    end if
end makeNewPath

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容