This very simple script displays the Unique ID, type, full path and URL of the items currently selected in the database explorer. To see information for other items, select the item(s) in the database explorer and click on the refresh button.
// Show Unique IDs of selected items /* Change History ----------------- 29-DEC-10 Tony Goodman Initial Version */ pragma runLim,0 DB dbMain = null DBE infoTextDBE = null /****************************** getInfo ******************************/ void getInfo() { Buffer outputBuf = create Skip selectedItems = getSelectedItems() // sneaky undocumented function... Item selectedItem string uid = "" string quid = "" string itemType = "" string rootOfItem = "" string urlOfItem = "" string nameOfItem ="" bool noItemsSelected = true for selectedItem in selectedItems do { // loop through the list of selected Items via the Skip noItemsSelected = false // got at least one Item // get required data... uid = uniqueID selectedItem quid = qualifiedUniqueID selectedItem nameOfItem = name(selectedItem) itemType = type(selectedItem) rootOfItem = rootName_(selectedItem) urlOfItem = getURL(selectedItem) if( itemType == "Formal" || itemType == "Descriptive" || itemType == "Link" ) { itemType = itemType " Module" } // Build output buffer... outputBuf += "Name: {\\b " nameOfItem "}\n" outputBuf += "Unique ID: " uid "\n" outputBuf += "Qualified Unique ID: " quid "\n" outputBuf += "Type: " itemType "\n" outputBuf += "Path: " rootOfItem "\n" outputBuf += "URL: " urlOfItem "\n" outputBuf += "\n" } // write out info gathered if( noItemsSelected ) { set (infoTextDBE, "No items selected") } else { set (infoTextDBE, stringOf( outputBuf )) } delete outputBuf delete selectedItems } /****************************** getInfo ******************************/ void getInfo(DB db) { getInfo() } /****************************** showUniqueIDs ******************************/ void showUniqueIDs() { dbMain = create(dbExplorer, "Unique ID of Selected Items", styleCentered|styleFloating) infoTextDBE = richText(dbMain, "", "", 500, 150, true) apply(dbMain, "Refresh", getInfo) realize(dbMain) getInfo() show(dbMain) } showUniqueIDs()