I had 3000 Pages documents that I wanted to convert PDF. I had previously searched the internet for a way to do this easily but was unsuccessful. I suppose I should have tried searching again, because I would have found Pages2PDF, which works much better than what I did.
Still, relying on someone to create the exact program you need is not as fun or as useful as being able to fix the problem yourself. So I created a Keyboard Maestro macro.
Basically, this automates the steps I would have had to do manually:
- Open the file in Pages.
- Select Export to PDF from the menu.
- Fix the file name.1
- Move the original file to a new location.
In Keyboard Maestro parlance the steps were:
- For Each Item in a the Finder’s selection
- Set the file name to a variable fileName
- Set the file path to a variable filePath
- Open the file at filePath/fileName2 in Pages.
- Pause for 1.5 seconds.3
- Select the menu item PDF… in the submenu Export in the Menu Title File.
- Press the Button labeled “Next…”
- Insert the text from variable %WindowName%1% by pasting. (Basically, this names the file being exported the same as the original file name, except for the extension.)
- Press the button labeled “Export”.
- Type the keystroke ?-W (to close the open file)
- Move the file %Variable%filePath%/%Variable%fileName% to whateverLocationYouWant/%Variable%fileName%
It worked perfectly if somewhat slow. It took several hours to process all the files.
For some reason, Pages kept truncating my filenames. ↩
I don’t know why I had to specifically use the path and name. Sometimes KM works fine without that and sometimes it doesn’t. I haven’t figured out why and when. ↩
I didn’t test this step any. I just assumed KM would need time for the document to fully open in Pages. ↩