Browser.msgBox(prompt) gives a timeout error - google-apps-script

Browser.msgBox(prompt) gives a timeout error in Google SpreadSheet when the user does not press OK for a longer time.
I know I could use "toast()" , but with this option, the user will not be able to acknowledge the end of the execution and they might not know if the process has run or not.
What I would need is an option which does not timeout regardless the time until the user presses an OK button.

When using Browser.msgBox(prompt) the script will pause at this line until the Ok button is pressed the script is still running and the 6-minute timer ticking away.
If you are just using this to notify the user that the script has finished and not as some input to the script I suggest you use the HTML service as this will allow the script to end but remain on the screen until it is acknowledged by the user.

Related

Running an Access Macro with Task Scheduler but want to hide Access whn it Runs. Not See Access Open and Close

I have created an Access Database with Queries and a Macro to manually run the queries when opened. I then set up a Task Schedule to open and run my Access Macro.
The issue is that I have it set to run every time I login to my computer but the issue is I would rather not see the Access Database open and close. Is there a way to run it in the background without even noticing it running?
You may check the security options of your task to see "Run whether the user is logged in or not" option is selected.
As an alternative approach, you may also consider to run your macro from the Timer event of a form in Access.
BR, Caglar

Run script timerbased clientside [GAS]

I have a script in a google spreadsheet which changes the activated cell.
I you have selected A1 for example the script activates A3.
If you run it again it selects A5 and so on.
This is what it should do.
Now I want the script to be run timer-based in foreground.
I installed a trigger for that but the script only runs in background when started by the trigger.
Background is that I have a PC running, showing an overview list.
This List has now grown to be longer than the Monitor can display.
So I want the PC to automatically scroll through the document let's say one step every minute.
I could do it with an iteration but that would stop the script after the execution time out of 6 minutes while the script should run about 8h a day.
Any ideas how to solve this problem?
Don't use GAS for this. It runs server side with it's non-adjustable constraints.
Use something like an automator which will simulate keyboard commands. You can script it client side, by sending the "down" button to scroll through your list. Check "Autoit" for windows.
not possible using triggers as they can only perform server side work.
the only possible way with apps script is to open a sidebar from onOpen and use setInterval to keep calling your server function.
this also consumes less time quotas as most of the time is spent from clientside than relying on the 6minute server limitto keep updating state.

Google App Scripts Error Notification on Non-Existent Script

How do I turn off alerts that I keep getting for a script that doesn't exist anymore? I created a google apps script to monitor a gmail account, but it didn't work right and I deleted the script. I currently have zero scripts associates with my account, but I still get this email every day:
Your script, Gmail Meter, has recently failed to finish successfully. A summary of the failure(s) is shown below. To configure the triggers for this script, or change your setting for receiving future failure notifications, click here.
Details:
Start Function Error Message Trigger End
1/28/15 1:16 AM activityReport Authorization is required to perform that action. time-based 1/28/15 1:16 AM
Sincerely,
Google Apps Script
There's a link to change seettings, but when I click the link I get a "Forbidden - Error 403" page (probably because the script isn't there anymore). It's super annoying anyone know of a way to turn of the alert that is causing this message?
I found this worked after getting script errors caused by 'Gmail Meter' which is an app I installed from the Chrome Web Store.
Go to script.google.com . If you were like me and have never been here before click the blue "Start Scripting" button.
Go to "Edit" menu -> "All your triggers".
A dialogue should pop up prompting you to save the current script. Rename to Temp and Click Ok.
Try to find the trigger that's sending the email and delete it. Or if you are like me, just delete whatever is there (which was only one line) by clicking the small gray 'x' at the start of the line.
Now it should state "No triggers set up. Click here to add one now."
Hope this helped.
This is interesting, it sounds like the Trigger is still running despite the script being removed.
Try creating an empty script, then select "All your triggers" from the "Edit" menu. You will be prompted to give your empty script a name, so call it "temp" or something along those lines.
Once the "All your triggers" window opens, hopefully you will see the trigger that's generating the error and be able to delete it by clicking the X.
Once finished you can delete your temp script.

MailFred Issue Emails

I recently changed the security in my Google settings and I keep getting an email that starts with the following sentence:
"Your script, MailFred 1.145, has recently failed to finish successfully. A summary of the failure(s) is shown below. To configure the triggers for this script, or change your setting for receiving future failure notifications, click here."
When I click there all I get is a 404 Forbidden page. Back in the email text there is a long list of when the script has failed. I am not sure how to fix this issue, but I would like to stop getting the emails.
Any help would be much appreciated!
Go to your Google Accounts Settings and under Security, click the Apps and Websites link.
Here you'll see a list of all scripts that have access to your Google Account. Revoke access to the one that is sending those error notifications.
You're right in your comment : revoking authorization while letting the script run is the origin of the error and the subsequent errors notifications...
I don't know the MailFred app but from what I saw on their site it's all built using Google-Apps-Script so I guess the trigger they use must appear as any other one...
To disable this triggers that is trying to run , follow these simple steps :
open any Google Spreadsheet, document or form
then open the script editor (from the "tools" menu),
go to 'resources' > triggers > all your triggers
and there delete the trigger(s) that you don't want to run.
If you see many of them, try to determine which one belongs to this app... you can check the notification mode, set it to a known time and wait for the next email, see at what time it was sent... The method is not very acurate (about an hour time frame) but it can help.
Sorry I can't be more concise, I don't use this app and didn't find a lot of informations about it.
Here is the example of how I did it. It's a pretty straight forward according to me.
See the following message I got when my script fails. It says,
"Your script, clearContent, has recently failed to finish successfully. A summary of the failure(s) is shown below. To configure the triggers for this script, or change your setting for receiving future failure notifications, click here."
You should be getting the same kind of message. Click on "click here" hyper linked text, it will directly take you to the settings page of that trigger. And, just change the setting of the particular trigger or delete it.

Google Apps Script Triggers not firing - but only sometimes

I have a few scripts that I want to run overnight so I've set up script triggers to execute these. Its all pretty straightforward stuff and they run fine. But occasionally, say once a month, one of them fails to execute. No error messages are sent to me by Google or anything like that.
Has anyone else experienced this? Has anyone got any ideas I can check for this error? Obviously if its the actual trigger that's not firing in the first place then the code won't actually run and therefore it won't be able to run any checks.
I'll also flag this with Google themselves in google-apps-script-issues forum.
I have a trigger set to fire every five minutes and a few times a month it will fail. Often it will say something about the function not being found.
You can be notified of an execution failure by setting up an "execution failure notice". In Resources > Current Script's Triggers, after each trigger will be a "notifications" link. Clicking it will open the "Execution failure notifications" window.
You have some choices about timing of the email notification of the failure.
Maybe: I suspect that, after I edit my code, sometimes the triggers miss fire. But I have never double checked this.
Suggestions:
1) add some logging and at the end of the script, grab the log and email it back to yourself.
2) Add a try catch around your code and email any errors that you catch back to yourself.
Google scripts are throttled in various ways and your script may be hitting up against one of these limits. There are limits on the number of emails you can send and limits on execution time of the script in addition to others.