Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hakr100

macrumors 6502a
Original poster
Mar 1, 2011
967
113
East Coast
All my clients use MS WORD. I like Apple Pages but I don't like the way I have to "export" Pages files to convert them to WORD format. Is there an idiot-proof script with simple invocation directions I can steal to automate by simple invocation the conversion of my Pages files to WORD files?
Thanks!
 
There is no great way to do this (for free, anyway). But this will work:

  1. Open Automator
  2. Create new Application
  3. Select Utilities from the Library list on the left
  4. Select Run AppleScript from the submenu
  5. Paste The text below into the Script entry box on the right
  6. (see the screenshot for clarification)
  7. In Automator: File>Save (keep it set as Application)
  8. This will save an app on your Desktop (or wherever you chose to save it).
  9. Now you can drag a folder full of Pages files onto the icon and it will open the Pages documents and save them as Word docs. It's not perfect, but it beats doing it by hand.

Code:
on run {input, parameters}

    --Select from where you will pick up the pages files
    set theSourceFolder to choose folder with prompt "Select folder with original pages files :"
    --Do it
    tell application "Finder"
        set theNames to name of files of theSourceFolder ¬
            whose name extension is "pages"
    end tell

    --Select where the files will go
    set theDestinationFolder to choose folder with prompt "Select folder where files will go :"

    -- How many files to export
    set item_count to (get count of items in theNames)

    --Get files and export them
    repeat with i from 1 to item_count

        set current_file to item i of theNames -- get a file
        set lean_file to text 1 thru -7 of current_file & ".docx" -- change the originalfile (.pages) to a .MS Word name
        set out_file to (theDestinationFolder as Unicode text) & (lean_file) -- get the fully qualified output name
        set in_file to (theSourceFolder as Unicode text) & (current_file) -- get the fully qualified input file name

        tell application "Pages"
            set mydoc to open file in_file -- open input file in Pages
            export mydoc to file out_file as Microsoft Word --do the exporting
            close mydoc saving no -- close the original file without saving
        end tell

    end repeat


    display dialog "done" -- Job done

    return input

end run

Screen Shot 2020-11-16 at 4.21.02 AM.png
 
What's the difficulty just using the 'share' command?
The square icon with an arrow in the address bar.
It gives you the option to convert to word format and then send it by email or message.
It even opens your email client automatically after it's created the file.
3 clicks total: can't get much easier.
 
What's the difficulty just using the 'share' command?
The square icon with an arrow in the address bar.
It gives you the option to convert to word format and then send it by email or message.
It even opens your email client automatically after it's created the file.
3 clicks total: can't get much easier.
I agree, but it would be smarter for the Apple app to allow customization so that if you want to save a file, Pages will autosave that file in WORD format. None of my clients uses anything but WORD. No clients use Pages for anything.
 
I agree, but it would be smarter for the Apple app to allow customization so that if you want to save a file, Pages will autosave that file in WORD format. None of my clients uses anything but WORD. No clients use Pages for anything.
^^This. Word is the industry standard. It were great if one could set Pages on using .docx als default. But yes, the compatibility has improved over the years, after all.
And if Pages could, as an option, display comments always in full text without the need to click on them (as it is in MS Word).
 
I'm "adept" in WORD but it really is far more complex an app for any of the professional or personal writing I do. PAGES is a likable app, lighter in weight than WORD, and I'm beginning to become PAGES-fluent, but...and this is a huge but...without complete and easy WORD compatibility, I just won't be able to make the jump. :(
 
The only thing that is fully compatible to Word is Word itself. Pages is a different tool by a different company with a different user basis serving a different purpose. From Apple's perspective it would make no sense whatsoever to add the possibility to default to DOCX or DOC since Pages is fully embedded into Apple's cloud service infrastructure that it would probably cause more harm than good.

That's why it defaults to its own proprietary format, and that's why you will have to jump through all those hoops to export a DOCX file. The only way you could improve upon this process is to add a custom keyboard shortcut but that's pretty much it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.