Previous 1 2 3 4 Next 84 Replies Latest reply: Nov 24, 2015 9:35 PM by mohair_slim Go to original post
  • Marlinespike Level 4 (1,880 points)

    Thank you, spazek!


    I already manually converted the files but I will try this as soon as practical and let you know how it works.

  • Rod Christiansen Level 1 (5 points)

    I found an very easy way to make .ppt to .pdf with automator

    Worked beautifully!


    Finder action: Selected files

    PowerPoint action: Covert Format of PowerPoint Presentations

    PowerPoint action: Quit PowerPoint


    Here is the screenshot:

  • mbinder Level 1 (0 points)

    I ran this, and it seemed to work, until Word warned me that the margins were outside the print area, and there was no script command to tell it how to proceed. Any ideas for that? All my docs will have that message...

  • macmee Level 1 (0 points)



    I would like to THANK YOU 256 times (= the amount of .doc files I had to convert to pdf).


    Have a nice day.

  • charlesfromdoral Level 1 (0 points)

    Very useful!

    I have a problem here. I only have in my library the Convert Format of PowerPoint related to Windows virtual machine version. I have Powerpoint for Mac 2011 installed. What I have to do? Thanks!

  • Rod Christiansen Level 1 (5 points)



    What could I add at the end of the script to make the finder delete the Word file? Meaning, after the script runs, I only want the PDF to exist.



  • spazek Level 2 (215 points)


    Sorry! I did not join here for a long time. Let´s start with the current question by Ron Christiansen:


    You could enter a line near the end of the AppleScript (the first one?)



                                            end if

                                  end tell

    tell application "Finder" to delete x


                        end try

              end repeat





    or in the GUI-Script:



      close theActiveDoc

                        end tell

                        tell application "Finder" to delete x


              end repeat




    This would be the most easy way.



  • jonnie5 Level 1 (10 points)

    Hi I have the same problem.  I can't convince automator to use my powerpoint for mac version instead of of that installed under parrallels. 





    Any ideas anyone?




  • spazek Level 2 (215 points)

    Maybe I did not understand (i am no native english speaker) ...

    Using Automator Action to Convert ppt(x) to PDF opens PowerPoint on a Windows virtual machine version?


    If so, this would be really strange and you can try to use AppleScript as well.

    Use it in the way described in the example workflow above



    property theList : {"ppt", "pptx"}


    on run {input, parameters}

              set output to {}


              repeat with x in input


                                  set thePPT to contents of x

                                  tell application "Finder"

                                            set theFilePath to container of thePPT as text


                                            set ext to name extension of thePPT

                                            if ext is in theList then

                                                      set theName to name of thePPT

                                                      copy length of theName to l

                                                      copy length of ext to exl


                                                      set n to l - exl - 1

                                                      copy characters 1 through n of theName as string to theFilename


                                                      set theFilename to theFilename & ".pdf"

                                                      set theOutputPath to (theFilePath & theFilename as string)

                                                      set PP to POSIX path of theOutputPath

                                                      tell application "Microsoft PowerPoint"

                                                                open thePPT

                                                                set theActivePPT to the active presentation

      save theActivePPT in theOutputPath as save as PDF

                                                                copy PP to end of output

      close theActivePPT

                                                      end tell

                                            end if

                                  end tell

      --tell application "Finder" to delete x

                        end try

              end repeat

      --tell application "Microsoft PowerPoint" to quit


              return output

    end run




  • sumtingwang Level 1 (0 points)

    Spazek, this is brilliant and has saved me much time, thanks!  I tried to dumb down the automator actions to the simplest steps, but Word keeps coming up the dialogue "Could not fire event."  Hmmm...


    I also need to convert the files to plain text and I am not familiar with AppleScript.  Problem is that the files contain English and another language, so they need to be encoded with Unicode 5.1, line breaks with CR only.  Could you tell me what needs to be changed in the script?



  • spazek Level 2 (215 points)

    Hi sumtingwang,


    Unicode 5.1 sounds as if you are using an older version of Word since the current Unicode version is Unicode 6.

    But ... truly said, i am absolutly not familiar with Unicode!


    To save a document as plain text you have to change following lines:


      set theFilename to theFilename & ".txt"




      save as theActiveDoc file format format Unicode text text encoding 6 line ending type line ending cr only file name theFilename


    or in your case



      save as theActiveDoc file format format Unicode text text encoding 5 line ending type line ending cr only file name theFilename


    or maybe even


      save as theActiveDoc file format format text text encoding 5 line ending type line ending cr only file name theFilename



    I am not sure about the command "text encoding 5"

    From AS Dictionary:

    [text encoding unsigned integer] : Text encoding to use when saving out as text file





  • sumtingwang Level 1 (0 points)

    Spazek, thanks much for the reply.  I did end up loading the Word libraries into Applescript editor and changing the lines you mentioned.  However, after a bit more searching and fiddling with the command line utils, I found this and modified it a bit:


    find . -name *.doc -exec textutil -convert txt '{}' \;


    Navigate to the parent directory with the word files in Terminal--it is recursive.  Took all of about 20 seconds to convert 120 files. 


    Thanks again!

  • Aaron Lee Level 1 (0 points)

    Hi spazek,


    First of the very all, thank you very much for your scipts; I have been searching for a solution for a month.

    Wasting a lot of time, and your scripts help me so much!!!


    I registered an account so that I can say thanks to you.


    million thanks.



  • latavarius Level 1 (0 points)

    THANK YOU Spazek!  You have made my life so much better with this converter-- I've been trying to work the bugs out of mine for some time.




  • allan_zip Level 1 (0 points)

    I'm trying to run Spazek's script to convert a folder of docs to pdfs but am getting the response

    "Move finder items was not supplied with the required data"

    When I run the scipt Word 2011 opens and launches each doc but when I close each file I get the message "Word could not fire event".

    I've followed the instructions closely; Get specified Finder items > Run AppleScript > Move Finder items

    not sure what I'm doing wrong. Any help?

Previous 1 2 3 4 Next