View Single Post
Old 01-16-2009, 02:15 PM   #16
EditorJack
Member
EditorJack began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
For anyone who might be interested, here's a java script (.bsh) that will parse a list of ISBNs and put the isbndb metadata into a text file. I'm using the script as a jEdit macro:

http://www.jedit.org/

Note that you must replace ISBNDBKEY with your actual isbndb.com key.

--------------------------------------------
//This macro parses a list of ISBNs and, using Calibre's isbndb function, generates a text file (c:\batch\metadata.txt) containing the acquired metadata.

runCommandInConsole(view,"System","cd c:\\batch");
textArea.setCaretPosition(0);
while(textArea.getCaretLine()+1 < buffer.getLineCount() )
{
textArea.selectLine();
String MyISBN = textArea.getSelectedText();
runCommandInConsole(view,"System","isbndb -i=" + MyISBN + " ISBNDBKEY >> metadata.txt");
waitForConsole(view); //Wait for isbndb to finish before going to next file
textArea.goToNextLine(false); //Go to next line without selecting it.
}
--------------------------------------------

Best wishes,
Jack
EditorJack is offline   Reply With Quote