You've got one more stage to go
The action returns its results (possibly including several matches) as a JSON string. See the synopsis on the readme sheet above, and the the end of the main function in the action:
// HARVEST IN JSON FORMAT
return JSON.stringify({
'doc': {
'URL': strPageURL,
'title': document.title
},
'anchor': oRoot ? nodeAttribs(oRoot) : null,
'xpath': strPath,
'firstOnly': blnFirstOnly,
'matches': nodesToRead.map(nodeAttribs)
}, null, 2);
and that JSON string is what you are capturing in your variable.
Imagine you are capturing that JSON string in a KM variable called xPathHarvest :
You can now add one or more simple Execute JavaScript for Automation actions which extract the part(s) you want.
For example:
The key line of this is JSON.parse(strJSON), which reads the JSON string into an active JS object, which you can extract things from or do further work on.
You can extract the .text value of the first match with something like:
(function (strVarName) {
'use strict';
var strJSON = Application("Keyboard Maestro Engine")
.variables.byName(strVarName)
.value(),
dctResult = JSON.parse(strJSON),
lstMatches = dctResult.matches;
return lstMatches.length ? lstMatches[0].text : undefined;
})('xPathHarvest');
Saving the output of that JS for Automation action in another KM variable like PakkeShopID
So the final stages of your macro might start to look something like: