Getting a list of active file viewers with apps script - google-apps-script

I've been googling for a while but have come up with no results that tell me I can't, but no results telling me I can.
What I'm looking for is a way in apps script (or anything in their .NET/Java/Python...API) to give me a list of people who are actively looking at the sheet when I ask. I tried getViewers but it gives me a list of all people with access, not the ones looking at it currently. If I wanted to do some data manipulation but didn't want to do it when people where in the file, or if I wanted to save the user emails of people who were in the file. It seems like it's part of analytics but I can't find anything that does what I want.
We have a working version that does some on open magic/button script trigger but this requires the user to authorize and would like to improve the process and remove the authorization step.
Anyone know a way to pull the list of people who are currently viewing a sheet/doc/slide?

It seems that this is not yet supported in Google Apps Script. I've been searching for this feature but unfortunately can't also find anything related. (Someone please correct me if I'm wrong or missed something related to this.) You're right that you can get the list of viewers but not the ones currently looking. I guess you can file a feature request for this.
If there is functionality missing from Apps Script that you would like to use, you can file a feature request on our Issue Tracker. Please describe the specific functionality you would like to see added, as well as reasons you think it's important. If possible, include specific details about your use case and the new opportunities the feature would allow for.

Related

Is it possible to get a full Gmail history and export it on a Google Spreadsheet?

Big premise: I know nothing about coding, but I think it may be the solution. I apologize in advance for any rookie mistakes regarding the matter (also spelling ones, as english is not my first language).
Background: very important emails have been deleted from an institutional account, even from the trash. I've managed to restore them by the Gmail Admin Console, via "restore data" option.
Retrieving said emails wasn't an issue.
Proving that those email were deleted in the first place, however, it is.
Looking for solutions day and night, I stumbled upon Gmail APIs, especially something called users.history.list. I had no luck in obtaining valuable results (again, I know nothing about coding).
So, my question is:
Is there a way to get a full Gmail History, proving that those emails were deleted in the first place, and export said results somewhere (ig. a Google Spreadsheet)?
I'm asking because legal action has to be taken, and this could be a start.
Thank you in advance, again, I apologize if this is not the right format but i runned out of ideas at the moment...

Google sheets import macros on multiple spreadsheets

Google recently added a feature where you can create custom shortcuts by linking it to Google App Script code. It seems pretty good and useful, except it seems the macros need to be setup spreadsheet by spreadsheet instead of in general across all spreadsheets.
I don't know about you guys, but I have multiple multiple Spreadsheets... close to 1,000 Spreadsheets that I edit sometimes. It would be impossible to import the macros one by one spreadsheet. Does anybody know how to do it for the "environment" as opposed to just one spreadsheet?
Seems like a great improvement for Google sheets, but kinda useless for me because I use so many spreadsheets.
Edit: I want to be able to write one macro and use it in any spreadsheet. I'm confused on whether this can be done because on one hand I read the docs and it said macro can't be distributed, but on the other hand other people have said you can do it by using GAS.
One of the comments below is absolutely correct, it is like the personal.xlsb excel workbook concept. In my opinion, shortcuts are useful only if they work all the time, it is a habit thing. It only is useful when it is consistent.
Google built-in shortcuts are useful because they work across all spreadsheets. If you had to set it up for each individual spreadsheet, I bet you no one would use them.
I wish google build in a developer mode or something that make them work for each spreadsheet without doing anything. I understand there are security concerns. But Google can figure it out.
If someone knows how to do it with GAS please post.

Is it possible to limit the controls/formatting allowed while editing in Google Docs?

I want to develop an academic papers repository system in which students can create/edit their docs. In this regard I NEED to take over the Docs Interface (e.g. a user CANNOT change font size). Digging into Docs (https://developers.google.com/apps-script/guides/docs) I've not found anything that allow me to get that job done!!!
The user will log into my app (it doesn't matter if he/her has a Google Account), cause I want full control over the docs.
So, I need to create an app with those requirements. Is it possible with Google Docs ???
Best regards,
Romualdo Rubens de Freitas.
As Bryan said in the comment, you can't disable the formatting tools... the best you could do is to write a script that continuously "reformats" your document, setting font styles, sizes and other format parameters to a value you choose.
This script could run on a timer to let it run periodically. I've written such a script for spreadsheets to keep the presentation the way I want and it works nicely... I guess it will be a bit trickier in documents because there are a lot more format parameters but it should be possible.

How can I summarize the updates to a table on an page I browse?

I am a student at a University. With the placement process going on, we have an internal placement website that shows updates and status about various companies I have applied to. Since the number of companies is too large it becomes cumbersome to scroll through the complete list to find information. Sometimes, I just miss some things. Now, to tackle this problem, here is what I want to do:
The data is in an HTML table. Each row shows information about one company: Some dates, Status(Not/Shortlisted/Applied), Some yes/no options etc. each in a different column. Once I open the page I want to be able to extract information about which companies I got shortlisted in, and in which ones I didn't make it.
What is the right technology to do this ? I am thinking of writing a Greasemonkey user script (I have never actually written any, but how hard could it be ?). What other options do I have?
Edit: I don't quite understand why this question has voted to be closed?
I just displayed a use case for something general: On opening a web page, automatically extracting information from the page and display it to the user. What is the easiest and sufficiently powerful way to achieve this?
Since you can't get access to the website's database, Greasemonkey would be your best automation approach. However, this task is likely to be over before you can get a decent script up from scratch.
Your best practical approach is to save the pages and/or copy and summarize the data in MS Excel, or equivalent.
~~~~~~~~~
Here at SO, We will not develop any but the simplest Greasemonkey scripts for you from scratch (unless they are fun somehow ;) ). But, you can sometimes get such help in the "Script requests forum" at userscripts.org.
In order for someone to help you, they will need:
A clear idea of exactly what data gets manipulated, and how.
Access to the target site. Or access to saved snapshots of the target pages. GM scripts are extremely dependent on the details of the target page.
"other option":
ctrl + F
enter shortlisted
enter
ctrl + G <--repeat last search

How do you database access (I/O) to/from Magento Commerce?

So, I want to import, export and modify the database. I have read that I have to do that by XML, but I don't really understand their doc system and I haven't found any good tutorials out there that explain this. I am slowly reading the very expensive and short book which is somewhat answering my questions, but I crave more.
As a second question, I want to have a order system where I can send out information or emails with my own code. I assume this would be some type of plug-in that would override or be called at a certain time. Any info would be helpful.
Some parts of the magento data can be imported/exported via the backend (System->Import/Export), namely products and customers.
If you want to deal with the complete DB - use your DB tool of choice (I prefer mysqldump).
When dealing with exported CSV.. use OpenOffice, from my experience it deals better with the separation characters than Excel.
As for your second question - as far as I understood, you will have to develop a module if you want to do something different than the existing functionality and keep the original mail functions. If you don't want to/have to keep the original functions, you can opt to overwrite the module, which is much easier as far as I can see. Google search for "overriding magento module" should turn up atleast one decent tutorial.
I found what I was looking for here:
(on magento site: Resources -> Magento Core API -> Product API or whichever API you want)
The problem is there is no Order API yet (or none that I've seen)
http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product#examples
This details how you'd write an external php script and obtain,edit or delete products (or anything else with an API).
Modules still look daunting, but I am reading through the (very thin) magento book (the only one available).
I hope this helps someone else.