Need help running a script

Do you want to: Ask a how-to question
I’m trying to run a script that will allow me to auto sort by a specific column whenever a change is made. I’m using a script that works on Google Sheets. But when I set it to autostart or I click run, nothing happens.

Document Server version:
Installation method:
OS: Mac OS 10.15.7
Browser version: Brave 1.31.87

function onEdit(event){
  var sheet = event.source.getActiveSheet();
  var editedCell = sheet.getActiveCell();

  var columnToSortBy = 10;
  var tableRange = "a3:ad103";

  if(editedCell.getColumn() == columnToSortBy){   
    var range = sheet.getRange(tableRange);
    range.sort( { column : columnToSortBy } );
  }
}

Hello bkarlan.
There’s no ready-to-go solution at the moment since we haven’t implemented range.sort method for API yet (bug number - 49609). Unfortunately I cannot provide you with exact timeframes of implementation at the moment.
Sorry for inconvenience.

Maybe you can just add the auto sort function to the spreadsheet to avoid the script?

Please describe what you mean by ‘auto sort function’. Please point us to this feature in MS Excel. Also we have sort feature in the editor, you can see it here: Sort and filter data - ONLYOFFICE