Can I export a bunch of Pages docuents into Word at once?

Discussion in 'Mac Basics and Help' started by amycishere, Jul 11, 2007.

  1. amycishere macrumors 6502

    Joined:
    Feb 1, 2007
  2. xUKHCx Administrator emeritus

    xUKHCx

    Joined:
    Jan 15, 2006
    Location:
    The Kop
    #2
    Don't think there are any applications out there that do this, but i have written a very dirty applescript (i don't have that much time to work around the basic applescript support in pages) that will export it for you. Basically all it does it press the buttons so it is very prone to failure. However i will provide it but there are some guidelines. It will export to the desktop, adjust the delays depending on how long your documents take to open, save etc. Just open Script editor, copy the code into it. Press run. It will then pop up asking for a folder with the pages documents inside it. Then it will go about opening and exporting them as word then closing the windows. Hope this helps and you can get it working.


    Code:
    tell application "Finder"
    	set pathoffolder to choose folder
    	set pagesfiles to entire contents of pathoffolder
    	repeat with each_item in pagesfiles
    		tell application "Pages"
    			set docname to open each_item
    			set nameofwin to name of front document
    			tell document 1
    				tell application "System Events"
    					tell process "Pages"
    						delay 1
    						click menu item "Export…" of menu 1 of menu bar item "File" of menu bar 1
    						delay 1
    						click button "Word" of radio group 1 of sheet 1 of window nameofwin
    						delay 1
    						click button "Next..." of sheet 1 of window nameofwin
    						delay 1
    						click button "Export" of sheet 1 of window nameofwin
    						
    					end tell
    				end tell
    				
    			end tell
    			close document nameofwin
    		end tell
    	end repeat
    end tell
     

Share This Page