The technote 53121 explaines and shows (with example code) how to query for the user-selected item from the SelectedImanObjects ContextItem.https://support.interwoven.com/kb/kb_show_article2.asp?ArticleID=53121
I am able to get the technote after having logged onto DevNet, selected TechLibrary, "Look-up By ID" from the left-hand pane, and passed in the document id 53121.TechLibrary is the top menu item right next to Forums.