This command prints the currently selected object/item/NPC reference ID to the console.
getselectedref
GetSelectedRef
This is the only way you can execute the GetSelectedRef command. This will print your currently selected reference ID to the console.