Whether you’re gearing up for your daily commute or a long-haul flight, the iOS iBooks app gives you an easy way to read documents on the go. To transfer a file onto your iPhone or iPad, simply save it as a PDF file, drag the file to your iTunes library (it will appear in the Books section), and sync it with your iOS device (if your iOS device is synced with another Mac this isn’t possible; the best option is to email it to yourself in this case).
Unfortunately, when you do this, some elements such as live links and audio, and video files can get lost. If you want to save a more interactive version of your files and web pages to iBooks, there’s another way: create an ePub version.
Mac OS X Lion offers a built-in means for doing this via Automator’s Text to ePub action. You can access it either by building a single-action Automator workflow, or by installing a few services and engaging those services via a contextual menu. We’ll start with the Automator method.
Use Automator to convert files
Launch Automator (in Applications), pick Application in the sheet that appears and click Choose. In the Automator window, select Text in the Library pane and drag the Text to ePub file item in the Actions pane to the workflow area. Click the Options button, and enable the Show this action when the workflow runs option. Choose File > Save and name the workflow (for example, Convert to ePub). Save it to the desktop as an application.
Now create your text document and save it as an RTF (Rich Text Format) file. (Any text editor or word processing application that supports RTF – including Microsoft Word and Apple’s TextEdit – will do.) When you’re done, save the document, and then drag its file icon onto the workflow application you created. A Text to ePub file window appears.
It’s within this window that the magic happens. Simply add the information the application asks for. Begin by entering the title for your document – this is the name that will appear within iBooks. Your author name is filled in automatically with your administrator account’s long name (you can change it if you want to). Enter a name for your file in the Save As field (this can be a different name than the title), followed by the .epub extension – My Book.epub, for example. In the Where pop-up menu, choose a location in which to save your file.
If you’d like to add a cover image to your book, just drag an image file to the Cover Image pop-up menu (or choose Other from that pop-up menu and navigate to the image you’d like to use).
You can also add an image, audio or movie file to the beginning or end of your book. To do so, click the Add button, navigate to the file you want to use, and click Add in the sheet. In the Place Media pop-up menu, choose whether to add that media to the beginning or end of the chapter.
Each chapter can have just one media file associated with it—an image, an audio file, or a movie. If you add more media files than there are chapters, each chapter will include a media file, and any leftover files will be added to the end of the book.
Click Continue and the application creates an ePub file, ready for syncing to your iOS device. After you’ve synced the file, just launch iBooks, locate your newly added book in the list of books, and tap it. Your cover art appears as the cover within iBooks; any art, audio or movies you’ve added to the book appear as well; and any web links are live. Tap one, and Safari opens on the device and takes you to the linked page.
You’re not limited to creating a single chapter, however. One way to add multiple chapters is to select them all and drag them to the application you created. They appear in alphabetical order, so you should provide them with names that are easily sorted such as chapter 01, the beginning; chapter 02, the middle; and chapter 03, the end. If, in our three-chapter example, you also add media files and choose to place them at the beginning of the chapter, each chapter starts with its own image, audio snippet or movie.
Download an easy-access service to convert files
Alternatively, you needn’t create this workflow at all. You can instead create an ePub book by using one of the services described at the Mac OS X Automation site (www.macosxautomation.com/lion). (The site also includes a fully constructed example file that you can download to your iPad.) The four installable services (download them from www.macosxautomation.com/lion/epub/agreement.html) include Create ePub book with contents of clipboard, Create ePub book with selected files, Create ePub book with selected text, and Create formatted ePub book with selected text. Double-click each one to install it in the correct location.
You invoke the first service by using the Services menu within an application. So, for example, while working in Pages, select some text, copy it, choose Pages > Services and, from the menu, select Create ePub book with contents of clipboard. The Text to ePub file window appears. Here you can add elements to your book.
The create ePub book with selected files option lets you add multiple files (each representing a single chapter). To use it, choose multiple text or RTF files in the Finder, Control-click (or right-click) on them, and select Services > Create ePub book with selected files from the contextual menu. Again, the Text to ePub file window appears. Configure it as outlined above.
Create ePub book with selected text works within a document. Select some text, Control-click (or right-click) on that text, and choose this service to open the Text to ePub file window. Note that the resulting ePub file won’t contain live links or the original file’s formatting.
Create formatted ePub book with selected text works the same way – select some text, invoke the command, and up pops the Text to ePub file window.
The difference between this service and the previous one is that the ePub book you create uses the original file’s formatting and live links.
Regardless of which method you choose, it’s easy to turn your media- and link-rich documents into iBooks-friendly files.