I am trying to write a script that sends some info to my server based on items read status, so I was mucking around with the script manager (SVN 2859) and got the following to work for the 'item selected' hook:

item = liferea.itemlist_get_selected()
if item ~= nil then
    title = liferea.item_get_title(item)
    io.write(string.format("%s: ", title))
    if item.readStatus == 1 then
        print 'read'
    else
        print 'unread'
    end
end

but as I want to keep track of read/unread status, it makes more sense to do what I need in 'item unselect' - but I can't get anything to fire from this hook. Something as simple as:

print "test"

won't work. So am I understanding this hook correctly? When I change to a new item will this hook be fired? And if so, is there a way to get the previously selected item - do the hooks provide the given feed/item when fired?

Also, something minor, but the Open-Folder-On-Select example on http://liferea.sourceforge.net/scripting.htm has an if statement close of 'fi', not 'end' that hung up this lua-noob for a minute last night.

Thanks for any help/advice.
Jim