A simple algorithm, in Corvid

Hi, indeed I’m checking a dynamic page. I did the following and I get a lot of errors.

let current = $w("#dynamicDataset").getCurrentItem.comments();
 if ( current === '' ) { 
  $w("#button1").disable();
  $w('#text29').text='No file to download. Button disabled!';
}
else {
  $w("#button1").enable();
  $w('#text29').text='Button functional! Proceed with download';
}