0
votes

I am using a script which is found here: https://moz.com/ugc/updated-tool-seomoz-api-data-for-google-docs

I would like to trigger this to run once an hour (as a test, later once a month); to facilitate this I set up a time driven trigger in the script editor UI.

I need to test that the trigger is actually working. The issue is that I do not expect any of the data to change when the script runs (might change once a month max)...

So I looked to the script editor and found View > Execution Transcript. Perfect!

Except that I get this message:

No execution transcripts found. Please run your script and try again.

No execution transcripts found. Please run your script and try again.

This doesn't seem to be consistent with the expected behaviour after reading the Google Apps Script documentation page, which says:

Every time you run a script, Google Apps Script records an execution transcript, which is a record of each call to a Google Apps Script service that is made while the script runs.

(Nothing in the logs either by the ways, though maybe this is something that needs to be turned on by the script itself; not sure).

So how can I test to see that my time driven trigger works, and that the script is being run each hour?

Final note: The script is executed by calling a function in the spreadsheet, as explained in the link at the top of the question.

2
Update: I let the script run on the trigger and the execution transcript worked... So just running it using the newly created function didn't do it, but the trigger did.Drewdavid

2 Answers

2
votes

If you have not yet run it manually, there may be an issue with it being given the proper permissions. Your first step would be to run the code manually using the play button. Once you know that the code itself will run successfully and has the right permissions, you can move to triggering it automatically.

Your next step is to shorten your trigger time so that it executes more frequently giving you more instances to check the function. Depending on the structure of your code, you can add Logger.log() calls at different steps to make sure that all portions are being called that need to be. You can then check you logs instead of the execution transcript as well.

These Logger.log() calls could include the time at which is was called to be able to verify that it was at the time/ frequency you need.

0
votes

Ok, I don't know how great this answer is... but:

For me (as per my comment to MasterCrander), running the script by means of using the function inside the spreadsheet didn't actually affect the execution transcript, but when it ran via the time driven trigger it made it into the transcript.

Problem solved.