10

I'm trying to set up Automator with a folder action to convert any Powerpoint or Word documents I drag into it to PDFs.

I found this question: How do I script Powerpoint to save a directory of PPTX files as PDFs?, but I don't have any Automator actions for Powerpoint or Word.

Here's what I see in Automator.Automator Actions

When I search in actions for "convert", here's what I get. search in Automator for "convert"

  • Mac OS 10.10.5
  • Powerpoint version 15.15
  • Word version 15.15
10

Microsoft Office for Mac 2011 (and 2008) includes several Automator workflows, but Microsoft is no longer providing Automator actions for Office 2016.

So, you must run an AppleScript from the Automator workflow

Here is the script (edited):

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 -5 of t) & "pdf"
    else
        return t & ".pdf"
    end if
end makeNewPath

This script return path of the PDF files to the next action.


Here is the workflow:

enter image description here

4
  • Great. That basically works, but only if I have PowerPoint open before I drag a file into the folder. If PowerPoint is not open when I drag a file in, I get an error dialog that says "There was a problem, and Microsoft PowerPoint was closed". – Mike Eng Nov 28 '15 at 4:42
  • 1
    Yes, I get this error when PowerPoint is not open. I edited the script in my answer, now no error for me. – jackjr300 Nov 28 '15 at 14:44
  • 1
    Doesn't work for me in 10.2.2. Automator gives the error "Expected end of line, etc. but found application constant or consideration.". It highlights the word "up" in "set start up dialog" – cavalcade Dec 9 '15 at 21:34
  • an improved version is available at apple.stackexchange.com/a/406988/57019 – Wolfgang Fahl Nov 22 '20 at 6:36
1

Do you have the full version of Microsoft Office installed?
The Automator actions are part of Office & added when Office is installed.
Microsoft Office Home and Student Edition does not have Automator Actions

enter image description here

Also see : Office applications missing in Automator Library

The mention on there of Viewing by Application or Category doesn't appear to prevent them showing in the search, only in the left pane

enter image description here

1
  • I'll have to check with my company's IT dept about that. Thanks for the lead. – Mike Eng Nov 24 '15 at 17:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .