Logic - Get Session Markers Info
By Nicolas Aparicio @Nicolas_Aparicio
Hi all,
here is a script to retrieve a Logic Session's Markers. This will return the marker numbers as well, to navigate to them if needed:
function getSessionMarkers() {
sf.ui.logic.invalidate();
sf.ui.logic.appActivate();
const markerWindow = sf.ui.logic.mainWindow.groups.whoseDescription.is("Marker").first;
const markerArea = markerWindow.groups.whoseDescription.is("Marker").first;
const rows = markerArea.scrollAreas.first.tables.first.children.whoseRole.is("AXRow");
const firstWindow = sf.ui.logic.children.whoseRole.is("AXWindow").first;
if (!markerWindow.exists) {
sf.ui.logic.menuClick({ menuPath: ['Navigate', 'Open Marker List'] });
firstWindow.elementWaitFor();
}
sf.ui.logic.invalidate();
const availableMarkers = rows
.map(row => row
.children.whoseRole.is("AXCell").allItems[2]
.children.whoseRole.is("AXCell").first
.getString('AXDescription')
);
firstWindow.getElement("AXCloseButton").elementClick();
let num = 1;
const markersInfo = availableMarkers.map(m => {
return {
name: m,
number: num++
};
});
return markersInfo;
}
Cheers,
Nic.