r/GoogleAppsScript • • Apr 14 '25

Question Custom Toolbars, Google does not offer support, any alternatives?

1 Upvotes

I'm doing a financial control "system" for a client, using the already in use spreadsheet model he uses, the people there are not really tech savvy and was asked to not deviate much from what is already established. Basically, I'm doing automations in the background and importing data to theses sheets.

I would really like to do a custom toolbar, with icons with custom options and dropdown's for navigation (a ton of sheets...). I already did some reasearch in the Google documentation, and they do not offer anyway of customizing the toolbar, or creating one that fit my needs.

One option would be to create a pseudo-toolbar at the first row of every sheet, but I think this is cumbersome and error-prone ...

Another option is to create a sidebar. In this specific use-case it would not work, as it takes to much screen space and they use two browser windows to view the dashboard sheet at the left and the sheet they are using on the right.

Have anybody found something that would permit something like that to be doable?

Thanks!

André


r/GoogleAppsScript • • Apr 14 '25

Question Script to create automatically Tasks in Google Task through Google Sheet

0 Upvotes

Hi, please, can you help me through this voyage?


r/GoogleAppsScript • • Apr 14 '25

Question Script very slow - How to speed up?

1 Upvotes

I have a script which is very simple but takes about 14 seconds to run. Anyway to speed it up?

Script:

function onEdit(e){
  if(e.range.getA1Notation() == 'E46' && 
      e.range.getSheet().getName() == 'NetWorth Dashboard'){
        e.source.getRange('H46').clearContent();
      }
}

This is in a workbook with 40 sheets. The E46 is a selector via data validation for a chart and H46 is a data validation list that changes bases on E46. So once E46 changes, anything selected in H46 is invalid and so needs to be cleared out.

TIA.


r/GoogleAppsScript • • Apr 14 '25

Resolved Apps Script Sending Emails in Plain Text Mode

1 Upvotes

So I made an apps script that sends emails using a spreadsheet and whenever i execute the code it sends it in plain text mode such that when you view it from a computer it jumps to a new line every 12-15 words. What should I do? I have disabled plaint text mode on my account by going to Compose, clicking the 3 dots and making sure the plain text mode option is unchecked. for reference here is the code:

function sendEmails() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
  var data = sheet.getDataRange().getValues();
 
  for (var i = 1; i < data.length; i++) { // Start from row 2 to skip headers
var email = data[i][0].trim(); // Email Address
var subject = data[i][1].trim();
var messagePart1 = data[i][2].trim(); // First variable section
var messagePart2 = data[i][3].trim(); // Second variable section
var message = "Hello Coach " + messagePart1 + ", \n\nMy name is Mo F, and I am a student athlete at Western High School in Townsville, CA. I am a part of the 2026 class and play Linebacker. I have a strong interest in " + messagePart2 + " and would love the opportunity to perform in front of you and learn more about your program.\n\nYou can reach out to me at: \n\nCell: (555) 867-5309 \n\nTwitter/X: f_mo \n\nEmail: fmo@gmail.com \n\nThank you for your time and consideration. I know you have a busy schedule, and I truly appreciate your attention. I look forward to the opportunity to connect and wish you the best of luck next season.\n\nBest regards, \n\nMo F http://blank";
MailApp.sendEmail(email, subject, message);
  }
}

r/GoogleAppsScript • • Apr 13 '25

Question Google Workspace Addon Launch Issue - Users Missing Side Panel Activatio

2 Upvotes

Has anyone noticed that Google Workspace addon installers aren't clearly informed that addons (unlike Editor addons) need to be launched from the side panel? I'm running into an issue where my users aren't activating my addon because they keep heading to the Extensions>Addon menu at the task bar instead. They're also skipping the manual, so the instructions there aren't helping much.

Is the Apps Script Dev Team doing anything to make this distinction clearer for Workspace addon users? Also any tips or workarounds to guide users to the side panel more intuitively?

#GoogleWorkspace #GoogleAppsScript #AddonDevelopment


r/GoogleAppsScript • • Apr 12 '25

Question What are the differences between Apps Script OAuth and Service Account?

2 Upvotes

Hi all,

I started coding with Google Apps Script and used Google Apps Script OAuth to connect to advanced services multiple times. A simple ScriptApp.getAuthToken() with permission on appsscript.json file allows me to retrieve Sheets API. On the other hand, I heard about setting up a service account could do the same, and I don't have to worry about 7-day reauthorization. I tried to search/AI but none give me useful information, so I just want to ask what are the differences between a service account and an Apps Script Oauth, and which should I use for automation workflow that require API connection?


r/GoogleAppsScript • • Apr 12 '25

Question differences between fetch and cURL?

1 Upvotes

I have a curl request like

curl -L "https://www.youtube.com/watch?v=ABCDEFGHIJK"   -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
  -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"   -H "Service-Worker-Navigation-Prelo
ad: true"   -H "Accept-Encoding: gzip, deflate, br"   -H "Accept-Language: en-US,en;q=0.9"   -H "Priority: u=0, i" -L --compressed -o response.html

Which works as expected. However, when I attempt to use GAS to do the same thing:

 const options = {
  headers: {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'Service-Worker-Navigation-Preload': 'true',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'en-US,en;q=0.9',
    'Priority': 'u=0, i'
    
  },
  muteHttpExceptions: true
  };
  const url = `https://www.youtube.com/watch?v=${videoId}`;
  const response = UrlFetchApp.fetch(url, options);
  var responseHTML = response.getContentText('UTF-8');

I end up with a strange output. For some reason it has hex escapes like \x22, as well as unescaped characters like '"'. Also, the JSON response is completely obfuscated, and more generally it just seems that the response I am getting doesn't match what I expect to get (and what I have gotten when trying postman, curl, etc.)

Does anyone know what is causing this issue, and how to fix it? Thanks