How to hide google Script activity in google Site recent changes? - google-apps-script

My google-apps-script is regularly updating the content of my google site List page. Every entry it deletes or adds is added to the "recent changes" of the website, making this list useless, cluttered with "you deleted/added an item to list...".
Is there a way to prevent the logging of these modifications by the script, exclude that particular page from the recent changes listing, or exclude the actions of a given user to be recorded (or displayed)?
Any suggestions would be appreciated,
Thanks.
Berteh.

As far as I know there is no way to prevent these changes from showing up.

manage site -> general tab, option is at very bottom, perhaps its a new change. You can specify who can see the recent site activity and revision changes and set it to collaborators (people allowed to edit the site) only, so it is not visible to public.

Related

Google Sheets: Why can't I insert a link (to anything) in a cell containing a formula

In any Google Sheet, select a cell containing a formula, for example, =SUM(1,1). You'll see that both the Insert->Link menu
and the toolbar button for Insert Link (Ctrl + K) are disabled.
Why is that?
PS:
I've spent considerable time on Google, but I haven't found this issue mentioned anywhere.
This problem occurs irrespective of whether the formula has been manually typed in the cell or been populated through Apps Script.
This is intended behaviour
If you press Ctrl+K when a cell with a formula is highlighted you get the following message:
Not sure if this applies to you, but I solved my problem after coming here. I realized that where I was trying to change the links was actually an "importrange" of another file. So I have a daily sales ticker that feeds out to our salespeople, but I don't want them to "see" my live file and accidentally make changes. So I use "importrange" to show just one page of my big file to the salespeople and if they accidentally make a change, it doesn't affect my original formulas. I was trying to update the links on the "shared version". Once I went to my original file, I could update the links as expected. It was ODD though that I was able to delete the link on the shared page. Just couldn't edit it or create a new link there.

Moving an item from one Google form to a new Google form using google apps script

When editing a Google form manually, you can usually click on an item, and on the side appears a menu, which includes the button "import questions". This button is very useful for me as it allows me to collect questions from past Google forms and import them to new Google forms.
But I'm looking through the Forms documentation, and I can't figure out how to do this via Google apps script programatically.
Here is the documentation:
https://developers.google.com/apps-script/reference/forms/form
The closest thing to what I want is the .moveItem() method, which moves an item from one spot in a form to another. But it only works within the same form. I want to know if I could do it across forms. And ideally, instead of moving the item, it would make a copy of the item in the new form.
I considered the .getItems() method, but there doesn't seem to be a general .addItem() method I could use on the new form. Would I have to go through the painstaking process of having to identify each item type, and specify how the details of each one should be copied to the new form, including things like point values of a question and whether or not the question is required?
I want to import from forms that have all kinds of content: video, images, multiple choice questions, grid questions, number scale questions, etc. I feel that if I have to specify the details of each item type, it would take too long, and I would be bound to miss something or run into an error that may be impossible to solve. Is there not an easier way?
And if specifying each item type is what I have to do to import everything properly, has someone else created that code already that I can re-use?
Issue:
In the current stage, unfortunately, it seems that Forms Service cannot copy all items. Ref1, Ref2 Ref3. And, unfortunately, moveItem can be used for the same Google Form as you say.
Workaround:
In your situation, as a workaround, how about copying the source Google Form? And, when there are some items you want to remove, you can remove them. I thought that this process can be achieved by Google Apps Script.
But, I'm not sure about your actual Google Form. So I'm not sure whether this is a suitable method.
Future:
Recently, Google Forms API was announced. Ref When this API got to be able to be used, your goal might be able to be achieved by retrieving the object from Google Form. Unfortunately, I'm still not sure about the detail of it.

Check that a link has been clicked

I would like to keep track of how many times a certain link in Google Spreadsheets has been clicked. I have been searching but I can't seem to be able to find how to check whether a link has been clicked or if it is possible to attach onclick event on a link.
A quick solution is to use the Google URL shorten service for the links. This page gives you the number of clicks per link.
its not possible, you cant detect cell or link clicks.
Two possibilities here:
One way is to have a server (or an apps script service) be the link "proxy" and redirect to the final site as in:
script.google.com/.../exec?url=myurl.com
your script tallies the hit and then redirects the user. redirecting without an extra click might not be possible with apps script htmlService but its possible on your own server.
you can make the urls look pretty by using =hyperlink in the cells so users dont see the long url (until click)
Another way if you have control of the links you are pointing to is to use analytics on those pages. You can use the referer to tally views that came from a spreadsheet click, or you can explicitly add parameters to each url so that youcan later filter those comming from your sheet.

ColdFusion Cookie/Form Submission Loophole

Okay so here is my problem. I have developed a framework which does the following:
If, for example, you have four webpages... but you only want to allow users to reach the "4th" webpage after progressing through pages 1-3 sequentially - I have built this functionality (basically I set an encrypted cookie keeping track of what the user has completed thus allowing to know what they should be able to access). There are two parts of it:
1) If a page does NOT have a quiz, the user must only visit the webpages sequentially to be allowed to view the 4th page in the "progression".
2) However, if a page has a quiz on it, the user must successfully pass the quiz to go on to the next sequential page.
Now... Here is the real biggie... The last page will often be a web form which, obviously, I only want an individual to fill out and submit if they have reached the form by sequentially getting to that last page in the progression... BUT I found a flaw in the system. If someone were to go completely through the progression and fill the form out... they could delete their browser's "form data" and go "back" to the form and allow a friend to fill the form out. That would be detrimental to the system, and the users who will be navigating this progression are GOING to look for ways to get around going through it.
Some of the suggestions I will probably get will not be possible given the larger framework I am in, but rather than list all of the impossibilities I would like to see what you guys thought would be a way of getting around this issue?
P.S. This functionality is built in HTML and ColdFusion.
Thank you for any feedback, it is a great help!
EDIT:
Keep in mind the user must be able to back track any previous page they already completed.

How do I modify the page level permissions using Apps Script?

I have a site with page level permissions set. Each page inherits from the parent, but then stops at a certain point. After a requirement is met, I want to allow access the the child pages.
The API has site level access, e.g.
site.addViewer(viewer)
site.removeViewer(viewer)
site.addCollaborator(collaborator)
site.getCollaborators()
site.removeCollaborator(collaborator)
But at the page level I only see
page.getAuthors
(Which I assume is the same as collaborators, but fail to see the reason for changing the name?)
Is it possible to change page level permission from a script in the site?
Doesn't seem to be possible. This issue in the Issue Tracker indicates that they're working on it. But this issue was created over a year ago, so I'm not sure the status of it...