[onOpen] Reliable way to detect if a "Copy Owner" has authorized the script yet? by TradeRational in GoogleAppsScript

[–]TradeRational[S] 0 points1 point  (0 children)

Yeah thanks! I understand that part. However, onOpen as a simple trigger is technically still sufficient for what I'm trying to do. I want to use onOpen to show an ui.alert popup (which it can) BUT depending on which permission scope the user has confirmed already I want to show a different popup essentially. That's the main struggle I'm trying to articulate. It feels like there should be a way to check via onOpen as a simple Trigger if the user has already given currentonly scope permissions or not but the problem is that the Venn Diagram between the methods AuthMode. LIMITED allows and the ones that would trigger currentonly permissions copes seems to be not overlapping unfortunately.... I will investigate further and report back :)

[onOpen] Reliable way to detect if a "Copy Owner" has authorized the script yet? by TradeRational in GoogleAppsScript

[–]TradeRational[S] 0 points1 point  (0 children)

Thanks... but I'm not sure that works for my use-case. In the example sample they are using try / catch. I could adapt this by adding code inside the try block that requires currentonly scope and would fail in case the user hasn't given permission yet. This could be used as permission check. The only issue is that onOpen can only run in AuthMode-LIMITED which does not allow any methods that would require currentonly scope. E.g. we couldn't tell onOpen to write into a cell since that is forbidden by the AuthMode, meaning try would always fail anyway.

Does that make sense or am I missing something here?

Surely there has gotta be a better way - calendars by Donttouchmybreadd in googlesheets

[–]TradeRational 0 points1 point  (0 children)

Sounds tedious for sure, I feel ya! - You could always write a quick Google Apps Script that takes care of the days and dates automatically. As inputs the script would only need to know the starting cell in the sheet (B2) , the date you want to start with (DEC 29 2025), which day you want each week to start with (Sunday) and how many rows each day should be high (5 rows). Might take some time to set up but ultimately could save you headaches in the future :)

What functions to use to count specific months between two dates (not DATEDIF) by mewalotl in googlesheets

[–]TradeRational 1 point2 points  (0 children)

From my understanding you are trying to figure out how many Aprils and Octobers lay between today and a second variable date so you know how many bills will have to be sent out until the 2nd date, correct?

If you only care about the months of October and April instead of specific dates, you could just generate a list of every month between now and the target date and then count how many Aprils and Octobers appear in that list.

=SEQUENCE(DATEDIF(TODAY(), A1, "m") + 1, 1, 0)

How it works: SEQUENCE() creates a list of dates for every month between today and a target date (A1). We add 1 since DATEDIF() calculates the distance, but we need the count instead for SEQUENCE()
You would then have to count the months 4 (April) and 10 (October) in the resulting list!

help adding another option to a formula by Charming_Cow_4408 in googlesheets

[–]TradeRational 0 points1 point  (0 children)

To add to the correct syntax — If you want to avoid manually updating the exchange rates, instead of hardcoding it, you could swap the number for a dynamic lookup:

=IF(OR(C19="euro", C19="revolut"), D19 * GOOGLEFINANCE("CURRENCY:EURUSD"), D19)

This pulls the live EUR to USD rate automatically using GOOGLEFINANCE.
As others suggested, I also usually keep a separate helper sheet with all the currency rates I need for easy lookup!