How to add custom spell check in Google Sheet through app script?

189 views
Skip to first unread message

Shame Mark

unread,
Apr 5, 2022, 3:28:05 AM4/5/22
to Google Apps Script Community
Want to make the autocorrect function in Google Sheet through the app script, but I'm a newbie in the app script and don't know too much about them, Can anyone help me with this. I'm using these codes for detecting spelling errors but don't know is these right or wrong.


function one(){
var dictionary = 'https://rawcdn.githack.com/maheshmurag/bjspell/master/dictionary.js/en_US.js';
var document = Logger.log(dictionary, function() {
  check.disabled = false;
});
check.addEventListener('click', function() {
  var text = div.innerText;
  var words = text.split(/\s/);
 
  div.innerHTML = words.map(function(word) {
     var correct = document.check(word);
     var className = correct ? 'correct' : 'misspelled';
     var title = correct
      ? 'Correct spelling'
      : `Did you mean ${lang.suggest(word, 5).join(', ')}?`;
     return `<span title="${title}" class="${className}">${word}</span>`;
   }).join(' ');
});

reset.addEventListener('click', function() {
  div.innerText = div.innerText;
});
}

Reply all
Reply to author
Forward
0 new messages