The wrench system probably has these stored in a global array somewhere, but I don't know what it's called. Though it's pretty easy to just generate your own list of items.
%count = datablockGroup.getCount();
%found = 0;
for(%i = 0; %i < %count; %i++)
{
%data = datablockGroup.getObject(%i);
if(%data.getClassName() $= "ItemData")
{
$itemDatablocks[%found] = %data;
%found++;
}
}
$itemDatablockCount = %found;