Create MediaWiki and RTF links for opening an ePub file at a specific position with Calibre viewer
Ebooks, unlike paper books, have no concept of pages. Instead, as you read through the book in Calibre’s Ebook Viewer, you will notice that your position in the book is displayed in the upper left corner in a box like this
. This is both your current position and the total length of the book. These numbers are independent of the screen size and font size you are viewing the book at, and they play a similar role to page numbers in paper books. You can enter any number you like to go to the corresponding location in the book (from Calibre’s manual).
On 02/12/2011 I asked for the addition of a book position argument in the ebook-viewer commad from Calibre’s developer Kovid Goyal. On 09/12 the 0.8.30 version of Calibre was released with the above enhancement incorporated in it! Thanks Kovid! As a result, now we are able to create links to a specific point of an ePub file which is very handy for reference reasons.
I modified the AppleScripts of the previous post and now when you execute them, a window will pop up and you will be asked for the specific book position. Afterwards, the necessary code will be sent to the clipboard. Finally, you should have selected the ePub file, for which you want to create the link, in Finder before executing the script.
The AppleScript code for creating MediaWiki links is the following:
The AppleScript code for creating RTF links is the following:
Create MediaWiki and RTF links for opening an ePub file with Calibre viewer
I have all my ePub files inside a Calibre database and I use its very nice Ebook Viewer for reading them. Unfortunately Ebook Viewer is not a seperate application and you need to open first the Calibre database, then find the file and at last you can open it with the viewer by pressing the V key. But there is a faster way to open it by using the following command in Terminal:
do script “ebook-viewer –raise-window \”/Users/MB/Downloads/Object-Oriented Programming with Objective-C.epub\”"
An extra advantage of this method is that the ePub file is not required to be inside a Calibre database! You can have your files wherever you want.
Of course, it is quite difficult to write the above command every time you want to read a book. But AppleScript can carry all that burden for us! Specifically I wrote an AppleScript which creates automatically the above command for a selected file in the Finder and wraps it up inside a MediaWiki link or a RTF link. Then you can just paste the link in a wiki page or a RTF document. Afterwards, every time you click the link an AppleScript editor window opens with the required AppleScript code inside it. Finally, you may press cmd + R (executes the script), cmd + W (closes the window) and cmd + D (without saving)!
The AppleScript code for creating MediaWiki links is the following:
The AppleScript code for creating RTF links is the following:
Some tools of the trade
- a MacBook Pro 17in
- a MacMini (as a server for my wikis and my ebooks library)
- an iPad
- a Time Capsule
- an iPhone 3G
- several external hard drives (for backup)
- a 27in LG monitor
In my academic workflow I use the following programs:
- Skim: for reading papers and books (in pdf format)
- Calibre: for organizing all my ebooks (read and unread)
- DevonThink: for organizing everything that I have read
- BibDesk: for reference management and automated bibliography creation
- MediaWIki: for notes management
- TextMate and LaTex: for writing my papers
- AppleScript: for automating my workflow



