Announcements
The Google Cloud Community will be in read-only from July 16 - July 22 as we migrate to a new platform; refer to this community post for more details.

How to combine two specific scripts together?

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?
 
Thank you guys, Martin.
Solved Solved
0 4 1,598
2 ACCEPTED SOLUTIONS

Thank you Marc. OK. Will ask "There".

I thought (as a beginner in coding), that it could be a simple stitch of these to scripts together, with a little efford.

So it seems, is not.

Thank you, Martin.

View solution in original post

Just ask chatGPT for help on that one

View solution in original post

4 REPLIES 4

This forum is for Appsheet, got App Script. I know there's a good sub on reddit for App Script where you should be able to get help.

But if you're asking for someone to "write it completely for me" I'd suggest you hire someone, like on Fiverr or Upwork. That kind of language doesn't really come across well when asking people for help for free.

Thank you Marc. OK. Will ask "There".

I thought (as a beginner in coding), that it could be a simple stitch of these to scripts together, with a little efford.

So it seems, is not.

Thank you, Martin.

Just ask chatGPT for help on that one

Great, Rafael.

I managed to solve it! Never used chatGPT for that. Amazing results!

Thanks a lot. Martin

Top Labels in this Space