I would go the AppleScript route. Create a text template by copying the below AppleScript template, taken from
Doug's Scripts and saving it as
iTunes Export.applescript in the following Bookpedia template folder ~/Library/Application Support/Bookpedia/Templates.
Code: Select all
tell application "iTunes"
launch
try
<!--BeginRepeat-->
set this_file to (POSIX file "[linksBegin][link:url][linksEnd]")
add this_file <!--EndRepeat-->
end try
end tell
After that you can select your collection in Bookpedia and use the File -> Export command and you will see "iTunes Export" as an option in the text export tab as template option. Clicking export will generate an Applescript and actually open it up in Script Editor, were you can press the "Run" button to have it executed and your books imported.
The only issue I ran into with testing is that the path is quoted as a URL, so if you have any spaces in your folders you have to quickly run find "%20" and replace all for " ". You can do this directly in Script Editor when it opens. It will also import duplicates, so you might want to amend the AppleScript to do a search in iTunes first based on the title.
Also the script can be updated to add specific details from the Bookpedia data with:
Code: Select all
...
set itunes_track to (add this_file)
set artist of itunes_track to "[key:author]"
set genre of itunes_track to "[key:genre]"
A full ist of all the track elements can be found by using "Open Dictionary" in Script Editor and selecting iTunes and looking for the track property, but here are some of the more interesting ones:
properties
album (text) : the album name of the track
album artist (text) : the album artist of the track
album rating (integer) : the rating of the album for this track (0 to 100)
artist (text) : the artist/source of the track
category (text) : the category of the track
comment (text) : freeform notes about the track
date added (date, r/o) : the date the track was added to the playlist
description (text) : the description of the track
duration (real, r/o) : the length of the track in seconds
enabled (boolean) : is this track checked for playback?
genre (text) : the music/audio genre (category) of the track
kind (text, r/o) : a text description of the track
long description (text)
modification date (date, r/o) : the modification date of the content of this track
rating (integer) : the rating of this track (0 to 100)
release date (date, r/o) : the release date of this track
sort album (text) : override string to use for the track when sorting by album
sort artist (text) : override string to use for the track when sorting by artist
sort album artist (text) : override string to use for the track when sorting by album artist
sort name (text) : override string to use for the track when sorting by name
sort composer (text) : override string to use for the track when sorting by composer
year (integer) : the year the track was recorded/released