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:

Leave a Reply