2/09/2023

How to add a label to previously created annotation in MakeSense.ai when you forgot to select a default one

Yes. Like the title said.


function selectOption(f){
  const a = document.querySelector('.DropdownOption');
    if(a===null){
        return setTimeout(selectOption.bind(null, f), 1);
    }

    a.click();

    setTimeout(f, 1);    
}

function selectLabel(label, f){
    label.click();
    selectOption(f);
}

function selectLabels(labels, f){
  function _do(){
    if(labels.length === 0){
        return f();
    }

    const l = labels.shift();
    selectLabel(l, _do);
  }

  _do();   
}

function selectAll(f){
  selectLabels(Array.from(document.querySelectorAll('.DropdownLabel')), f);
}

function loop(){
  if(document.querySelector('[draggable="false"][alt="next"]') !== null){
    console.log('Done!');
    return;
  }
  
  selectAll(() => {
      document.querySelector('[alt="next"]').click();
      setTimeout(loop, 100);
  })
}

loop();
« »
 
 
Made with on a hot august night from an airplane the 19th of March 2017.