Previous 1 2 Next 18 Replies Latest reply: Mar 28, 2014 1:33 AM by BesserKeller
Edward Cross Level 1 Level 1 (45 points)

Is there any automated way of converting Pages 4.3 documents to MS Word document format?

I know that I can open each one in Pages and Export them, but prefer not to have to manually do it to all my files.

 

Switching to MS Word so, I'd like to move all my existing Pages docs to Word format. Tired of this 1 step forward, 5 steps back approach of Apple when it comes to their productivity apps. They cease to be productivity apps.

  • PeterBreis0807 Level 7 Level 7 (32,805 points)

    Agreed.

     

    Have you had a look at using Automator to do the opening and exporting for you?

     

    Peter

  • Edward Cross Level 1 Level 1 (45 points)

    Actually was looking for either a script or workflow that someone had already done to perform this.

     

    I am so aggravated over this iWorks debacle. It's like Dewalt Tools reinventing the saw with all kinds of new features and innovation. Marketing it as the last saw you will ever need. However there's one caveat: it doesn't cut a straight line because in their corporate re-imagining of the saw they didn't see a need to be able to cut a straight line because curves are so much prettier.

     

    To add insult to injury we are then told to send feedback to the company to let them know that it should do what a saw is supposed to be able to do - cut a straight line. Are we to assume they didn't know that a saw is supposed to be able to cut a straight line and that we'd be upset when we found out it didn't?  Are we dealing with 2 year olds or professional developers? To call Pages 5 "the last word in word processors" and to have removed the productivity tools that are just part of page layout/word processing like link text boxes, mail merge, applescripting etc; is just an insult and a demonstration of a lack of consideration to the end user.

     

    Professional people can't afford to reinvent work flows every time Apple innovates and in the process breaks everyone's workflow. It takes the productivity out of the productivity.

     

    Apple needs to spend some of those billions of cash reserves, hire a bunch of programmers and fix this NOW, not later. iWorks Pages needs to be brought up to feature parity with the old Pages within weeks, not months, and they need to inform their customers of their intentions to do so. Right now we are left to assume that within 6 months only window dressing is going to be added back in with no indication of hardcore features returning. We are also left to assume that old Pages will eventually become unfunctional with OS updates, as Appleworks eventually did. We need to know they are going to fix this, not have to hope that they will. Either that or we need to find a solution that works now and has a track record of on going stability.

  • Magnus Lewan Level 4 Level 4 (3,655 points)

    There have been scripts around, but I stopped trying to maintain the ones I wrote, as the script dictionary changed each version. You may be helped by http://pagesfaq.blogspot.fr/2008/01/export-folder-to-word-rtf-pdf-txt-or.html . There are more links to other attempts at http://pagesfaq.blogspot.fr/2006/11/i-have-one-thousand-pages-documents-to.html .

  • Edward Cross Level 1 Level 1 (45 points)

    Thanks I have looked at a number of scripts, most failed for the reason you mentioned. I managed to get one working. Pasted the following into Applescript Editor and saved as an application to the desktop. You can then drag and drop files from any directory and it converts them and saves in the same directory as the original pages document.

     

    on open theFiles

              tell application "Pages"

                        repeat with aFile in theFiles

      open aFile

                                  set docName to name of front document

      -- Remove .pages extension.

                                  set prevTIDs to AppleScript's text item delimiters

                                  set AppleScript's text item delimiters to ".pages"

      -- Add .doc extension.

                                  set docName to first text item of docName & ".doc"

                                  set AppleScript's text item delimiters to prevTIDs

      -- Get folder that dropped file exists in.

                                  tell application "Finder"

                                            set sourceFolder to (container of aFile) as Unicode text

                                  end tell -- Finder

      -- Save file to folder that dropped file exists in.

                                  set docPathAndName to sourceFolder & docName

                                  save front document as "Microsoft Word 97 - 2004 document" in docPathAndName

      close front document

                        end repeat

              end tell

    end open

  • Beacher3 Level 1 Level 1 (0 points)

    Every so often one finds something on the internet that is really beautiful and this is one time for me. Thanks Edward. Your little script has saved me a LOT of time.

  • foxygenn Level 1 Level 1 (0 points)

    I keep getting the following error message: "Can't make 'Microsoft Word 97 - 2004 document' into type constant." Am I doing something wrong or is it perhaps because I have Word 2011?

     

    Thanks!

  • nscozzaro Level 1 Level 1 (0 points)

    Hey Foxygenn,

       I got yo back! Try this:

     

    on open aFile

              tell application "Pages"

      open aFile

                        set docName to name of front document

                        set sourceFolder to POSIX path of aFile

                        set newsourceFolder to characters 1 thru -8 of sourceFolder as string

                        set theFolder to newsourceFolder & ".docx"

      export front document to POSIX file theFolder as Word

      close front document

              end tell

    end open

  • foxygenn Level 1 Level 1 (0 points)

    Perfect, thank you nscozzaro!

  • nscozzaro Level 1 Level 1 (0 points)

    Good. If you select multiple files, this version will do them in batch and deletes the original, so you are only left with the .docx:

     

    on open theFiles

              tell application "Pages"

                        repeat with aFile in theFiles

      open aFile

                                  set sourceFolder to POSIX path of aFile

                                  set newsourceFolder to characters 1 thru -8 of sourceFolder as string

                                  set theFolder to newsourceFolder & ".docx"

      export front document to POSIX file theFolder as Word

      close front document

                        end repeat

              end tell

              tell application "Finder"

                        repeat with aFile in theFiles

      delete aFile

                        end repeat

              end tell

    end open

  • foxygenn Level 1 Level 1 (0 points)

    This is perfect -- does just what I was looking for initially. Thanks so much!

  • bryanbeus Level 1 Level 1 (0 points)

    Thank you very much, nscozzaro,

     

    Also, I wanted one that does multiples without deleting the originals. So, with my inept programming skills, I goofed around until I got this one which seems to work also.

     

    Here it is, just in case anyone else needs it:

     

    on open theFiles

              tell application "Pages"

                        repeat with aFile in theFiles

      open aFile

                                  set docName to name of front document

                                  set sourceFolder to POSIX path of aFile

                                  set newsourceFolder to characters 1 thru -8 of sourceFolder as string

                                  set theFolder to newsourceFolder & ".docx"

      export front document to POSIX file theFolder as Word

      close front document

                        end repeat

              end tell

    end open

  • qwedcxza0 Level 1 Level 1 (0 points)

    It will drive you crazy to manually convert a large number of files. Try iWork Converter( http://tyorex.com/iWorkConverter )!

  • zwg2 Level 1 Level 1 (0 points)

    bryanbeus and nscozzaro:  thanks a ton for posting these scripts.  I tried both, but as a AppleScript newbie I couldn't get past the following syntax error when I pressed compile:

     

     

    "Expected end of line, etc. but found “front”." 

     

     

    ...with the following "front" highlighted in the script:

    "export front document to POSIX file theFolder as Word"

     

     

    I am on an old iMac running 10.5.8 trying convert to Word from Pages before backing up all files and upgrading my machine and OS.  Pages is version 3.0.3.  ScriptEditor is Version 2.2.1 (100.1).  AppleScript is version 2.0.1.

     

     

    Any ideas on how I can adjust the script to get it to work?

     

     

    [

    Similar to foxygenn: I was able to compile the first script suggestion from Edward Cross, but when I dragged and dropped it came up with the following error:

     

    "The document cannot be exported to the "Microsoft Word 97 - 2004 document" format."

     

    I tried replacing the phrase in the script with WORD and .doc but got the same message.

    ]

     

     

    Thanks much to anyone for any help.

  • zwg2 Level 1 Level 1 (0 points)

    Ok maybe nevermind.  Looks like I got the following to work, which suits my needs for now.  It uses the Edward Cross version above with the only change being from

     

    " ...save front document as "Microsoft Word 97 - 2004 document"...    "

     

    to

     

    "save front document as word"

     

    See below for full script.  So far so good. 

     

     

     

    on open theFiles

      tell application "Pages"

      repeat with aFile in theFiles

      open aFile

      set docName to name of front document

      -- Remove .pages extension.

      set prevTIDs to AppleScript's text item delimiters

      set AppleScript's text item delimiters to ".pages"

      -- Add .doc extension.

                                  set docName to first text item of docName & ".doc"

      set AppleScript's text item delimiters to prevTIDs

      -- Get folder that dropped file exists in.

                                  tell application "Finder"

      set sourceFolder to (container of aFile) as Unicode text

                                  end tell -- Finder

      -- Save file to folder that dropped file exists in.

      set docPathAndName to sourceFolder & docName

      save front document as word in docPathAndName

      close front document

      end repeat

      end tell

    end open

Previous 1 2 Next