Hi guys. I´m new to this place and bad coder, so sorry to write here like a rookie.
I read many manuals how to combine two scripts together, but didn´t help me with my task. Because I´m coding analphabet. And yet, I need the coding.
This script bellow (highlightNotes) , works very nice alone. But I need to execute it everytime when I edit the Google Sheet. Probably merge it with function onEdit(e) ?
/**
Here is the script, that fills the background color, where Note is inserted.
*/
function highlightNotes() {
const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getDataRange();
const notes = range.getNotes();
const orange = notes.map(row => row.map(note => note ? ‘orange’ : ‘’));
range.setBackgrounds(orange);
}
That script executes only when I play it manually. I need to keep it active in background all the time.
I tried different combinations, how to merge onEdit and function highlightNotes(), but I´m really bad with codes.
Can someone write it completaly for me?
Example of my sheet is here https://docs.google.com/spreadsheets/d/1qG_P_EYnEw28pfIQew7ZbpmvgO6Ie5D0HpsezoCMNCg/edit?usp=sharing
Thank you guys, Martin.