Updated: 16/2/2020
- New Author Search function.
- Convert to AZW3 added.
- Convert to PDF added.
- Minor tweaks to other buttons to suit Opus changes since these were created.
A few buttons to manipulate eBooks and your Calibre Database:
For convenience here's a complete toolbar ready for you to use: Calibre.zip (942 Bytes)
Alternatively, if you wish to use the individual buttons below, here is how to use the code blocks: How to use buttons and scripts from this forum
Create Book List
This one creates a file called "booklist.txt" in the current source directory of Opus. This list contains author, title, series and series_index for each book. There are additional arguments which can be added to include other columns (see https://manual.calibre-ebook.com/generated/en/calibredb.html for further info).
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>Create Book List</label>
<icon1>C:\Program Files (x86)\Calibre2\calibre.exe,0</icon1>
<function type="batch">
<instruction>@runmode:hide</instruction>
<instruction>"C:\Program Files (x86)\Calibre2\calibredb.exe" list --ascending --fields authors,title,series,series_index --sort-by authors --line-width 500 > "{sourcepath$}BookList.txt"</instruction>
</function>
</button>
Author Search...
Prompts for an author name (or partname) and creates a text file in the source folder (named identically to your search.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" separate="yes" textcol="none">
<label>Author Search...</label>
<icon1>C:\Program Files (x86)\Calibre2\calibre.exe,0</icon1>
<function type="batch">
<instruction>@runmode:hide</instruction>
<instruction>@set strAuthor={dlgstring|Enter author name}</instruction>
<instruction>"C:\Program Files (x86)\Calibre2\calibredb.exe" list --search "{$strAuthor}" --ascending --fields authors,title,series,series_index --sort-by authors --line-width 1000 > "{sourcepath$}{$strAuthor}.txt"</instruction>
</function>
</button>
Add Book/s
Add all selected files to the Calibre database.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>Add Book/s</label>
<icon1>#newcommand</icon1>
<function type="batch">
<instruction>"C:\Program Files (x86)\Calibre2\calibredb.exe" add "{filepath}"</instruction>
<instruction>pause</instruction>
</function>
</button>
View Book
View the first selected file in Opus in the Calibre book viewer. Selected file must be a valid ebook format of course.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" separate="yes" textcol="none">
<label>View eBook</label>
<icon1>#viewerpane2</icon1>
<function type="normal">
<instruction>"C:\Program Files (x86)\Calibre2\ebook-viewer.exe" {filepath}</instruction>
</function>
</button>
Convert to AZW3
Converts all selected files to the Kindle compatible .azw3 format. This will work with a pile of ebook formats including .pdf. The converted file will have the same name as the source file with the .azw3 extension of course. These will be created in the same folder as the source file.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>Convert to AZW3</label>
<icon1>#imageconversion</icon1>
<function type="normal">
<instruction>cd {sourcepath$}</instruction>
<instruction>"C:\Program Files (x86)\Calibre2\ebook-convert.exe" {filepath} .azw3</instruction>
</function>
</button>
Convert to MOBI
The same as the AZW3 converter but it will convert to MOBI format.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>Convert to MOBI</label>
<icon1>#imageconversion</icon1>
<function type="normal">
<instruction>cd {sourcepath$}</instruction>
<instruction>"C:\Program Files (x86)\Calibre2\ebook-convert.exe" {filepath} .mobi</instruction>
</function>
</button>
Convert to EPUB
The same as the AZW3 converter but it will convert to EPUB (Not Kindle compatible) format.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>Convert to EPUB</label>
<icon1>#imageconversion</icon1>
<function type="normal">
<instruction>cd "{sourcepath$}"</instruction>
<instruction>"C:\Program Files (x86)\Calibre2\ebook-convert.exe" {filepath} .epub</instruction>
</function>
</button>
Convert to PDF
The same as the AZW3 converter but it will convert to PDF format. Be aware that there can be issues with PDF conversion, it doesn't always work well. The Calibre forums are full of people with PDF conversion issues.
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" separate="yes" textcol="none">
<label>Convert to PDF</label>
<icon1>#imageconversion</icon1>
<function type="normal">
<instruction>cd "{sourcepath$}"</instruction>
<instruction>"C:\Program Files (x86)\Calibre2\ebook-convert.exe" {filepath} .pdf</instruction>
</function>
</button>