Here is a script that gets the UniqueId of a list item:
<script type="text/javascript">
$(document).ready(function()
{
ExecuteOrDelayUntilScriptLoaded(
function()
{
var itemId = ....; // change to the real id
var listTitle = .... // the list title
var ctx = SP.ClientContext.get_current();
var list = ctx.get_web().get_lists().getByTitle(listTitle);
var item = list.getItemById(itemId);
ctx.load(item);
ctx.executeQueryAsync(
function ()
{
alert('Request succeeded. \n\nRetrieved Item is: ' + item.get_item('UniqueId'));
},
function(sender, args)
{
alert('Request failed. \nError: ' + args.get_message() + '\nStackTrace: ' + args.get_stackTrace());
});
}, "sp.js");
});
</script>
Hint: If your ribbon action is used in a list view, then you could use the following to get the current list:
var listId = SP.ListOperation.Selection.getSelectedList();
var list = ctx.get_web().get_lists().getById(listId);