Print Google Workspace Gmail Address lists in GAM - open-source

I would like to know, is there any way to print using GAM the entire Gmail address lists (and their contents) found on the Admin console by going to 'Apps'> 'Google Workspace'> 'Gmail'> 'Routing'> 'Manage address lists'?
I have researched on GAM but so far no clear ways on how to do it. I have also tried exporting the page as HTML code and then using regex but not very time efficient

Related

403 error from Google Drive direct link due to multiple accounts logged in

I have a number of images in Google Drive and I am wanting to use them in various ways via the direct link style:
https://drive.google.com/uc?id=DOCID
In Chrome I am logged into three different Google accounts, my corporate one, my personal one, and one other. If I navigate through the Google Drive interface to my files in the corporate account I can see them fine. If I use the form https://drive.google.com/open?id=DOCID then the Google Drive interface opens properly with the image displayed. However, when I try to access the file directly using the uc?id= URL style above I get a 403 error.
"403. That’s an error.
We're sorry, but you do not have access to this page. That’s all we know."
I have tracked this down to being because when I use this URL form, for some reason Chrome or Google Drive are using the wrong authentication credentials - i.e. the ones from my personal account even though this file is in my corporate account.
I've proved this by firing up Firefox, which isn't authenticated to any account, logging in as my corporate user, and then using the URL above: bingo, the image is displayed.
So my question: is there any way to force the URL style above to use the correct set of credentials when accessing the file?
You can use drive.google.com/u/1/uc?id=DOCID or drive.google.com/a/mycorporatedomain.com/uc?id=DOCID
However, do not rely on these URL's not changing in the future.
Log out of all the accounts and only log in just one needed account. This works for me. The google free 15 GB is good since I can always create new email but difficulty in downloading file give drop box an edge.

Google Drive for hosting JSON post 'host' discontinuation (August 2016)

While it appears that we will still be able to use google drive to host images for websites (when load speed is less of an issue than users being able to add things when they do not know any html). I have been using google apps scripts to generate JSON files that are then loaded to build webpages (This way I could have people add images to a folder, and lines on a spreadsheet and the page builds automatically). I noticed a couple of other people asking questions about this, so it is not only going to effect me. However with Google ending their 'host' feature in August, has anyone come up with a solution other than just make a small server that grabs the JSON file occasionally and hosts it in a way that allows cross domain access?
Well I found a work around inside google apps script for anyone interested. There is one large problem with it. It does not work on any safari browsers due to a known, but triaged bug. (https://code.google.com/p/google-apps-script-issues/issues/detail?id=3226) This is something I should have thought of before, as I have used it as a trick in the past:
function doGet() {
var myFile = DriveApp.getFileById('<FILE_ID>');
var str = myFile.getBlob().getDataAsString();
return ContentService.createTextOutput(str).setMimeType(ContentService.MimeType.JSON);
}
Once you have your id set up go to Publish->Deploy as Web App, set things to Execute as me, and anyone even anonymous can access. The URL https://script.google.com/macros/s//exec will allow cross domain grabs at this point.
This, I believe, will have a quota that could in theory be overwhelmed, but you can always choose to pay for more access. In my case I will just add direct access to the JSON generated by the original script so I will not hit google drive quotas, but this should work fine for any reasonably small project that does not need Safari access...

How to make starting a UiApp by a group of users easy?

After opening Gmail or Google Drive you see the google bar (containing the Google logo, a searchbox and clickable button for apps, notification of unread messages, sharing and about) on top of the window.
I want to put a put a button for starting my UiApp (build with GAS) there as well.
Is this possible (and how) ?
Several users will have read access to the google drive. I want those users to be able to start my UiApp from a button in google bar as well. What should I do (and what should they do) to make that possible?
If this is not possible, where can I put my UiApp best so users can start it easy?
My application is NOT intended to be accessible by other people except the ones I provided access to my Google Drive.
I believe you can accomplish this by leveraging the Gadgets section of the Gmail API to accomplish this as detailed here. I've seen this type of Gadget added by a Chrome Extension before but not directly from Google Apps Script.
I think you would need to use the "New" button, and publish a script to the Chrome Web Store. Then your app would be in the drop down list of the "New" button. The problem with that, is that the general public could see the app. I'm assuming you don't want that.
If you want an easily accessible central location for users, you could create a website with Google App Engine. You can get a free domain name of
www.mySiteName.appspot.com
It would be easier for users to get there than the URL of your Apps Script.

Conditions of using webContentLink?

Which kind of cookie is required to work with webContentLink? I noticed when I'm logged in to Gmail only, i get 403 error. When I open Google Drive too in on other tab and check some files, then my webContentLinks starts to work. Is this the way it should work or did I missed something? Once it was sufficient to be logged in only in Gmail...
(I have a very simple web application, that shows some links to files I shared with my friends in Google Drive. I don't want to use further authentication, but public is also not an option. It was very convenient to have accessible links when their Gmail is opened.)

Copy/Paste in JavaScript?

I know this question was asked like a million times by now, but I couldn't really find a good up-to-date solution.
I've implemented my own menu to provide the user the ability to Cut, Copy and Paste into my WebApp.
But I'm not sure how to actually work with the clipboard on Firefox, IE, Safari/Chrome.
Thank you for your help.
I just wrote a detailed technical blog post on this very subject (I work for Lucidchart and we recently did an overhaul on our clipboard). Included in the post is this fiddle which is a working example of copying and pasting via Javascript.
The good news is that this example gives you working code for setting/getting any supported clipboard data types whenever the user uses a clipboard hotkey.
The bad news is that using your own context menu to copy and paste is problematic. Even Google can't get around this (try using context-menu copy or paste in Google Docs in Firefox). You'll be able to get it to work without too much trouble in IE. This is because you can access the clipboardData object at anytime from Javascript via:
window.clipboardData
(When you attempt to do this outside of a system cut, copy, or paste event, however, IE will prompt the user to grant the web application clipboard permission.)
In Chrome, you can create a chrome extension that will give your web app clipboard permissions (this is what we do for Lucidchart). Then for users with your extension installed you'll just need to fire the system event yourself when they click the menu option:
document.execCommand('copy');
It looks like Firefox has some options that allow users to grant permissions to certain sites to access the clipboard, but I haven't tried any of these personally.
did u try :
http://ericphan.info/development/cross-browser-copy-and-paste-with-jquery-copy/
UPDATE:
the link is not available so i copy the content from cache :
The Scenario
I was working on a client project for SSW when the client reported a bug in the web app.
The bug involved a dynamically generated mailto link that got updated when you selected multiple employees. The client was reporting an error when he selected more than 10 employees to email. His Lotus Notes mail client popped up an error saying:
Error processing command line arguments
Testing this myself I found that Outlook 2007 could easily support the emails of 30-40 employees before the mailto link stopped working.
The Cause
It turns out that the mailto spec has a limit and the mail clients also have a limit. Lotus Notes only handles 240 characters in the mailto link and other modern mail clients like Outlook 2007 support the 2083 characters - the max length of a URL
This explains the discrepancy in testing.
The fix - JQuery to the rescue
Since this is a limitation of the HTML spec we needed another solution to meet the client’s requirement of “I want to be able to select multiple employees and send an email to all of them”
We could have created an email form that used SMTP to send out the email - but the client wanted to use Lotus Notes as his mail client.
We ended up changing the “email” button to copy all the emails (comma separated) onto the clipboard and popped open a new email window. All the client had to do was hit CTRL + V and paste the emails into the TO field. This was the quickest and most cost effective solution that gave the client the flexibility to use their own email client.
There is a JQuery plugin called jquery.copy that provided cross browser copy and paste by using a flash (swf) file. This is similar to how the syntax highlighter on my blog works.
Once you reference the jquery.copy.js file all you need to do to push data into the clipboard is run the following:
$.copy("some text to copy");
Nice and easy ;)
Note: you may need to change the path the the SWF file in jquery.copy.js to get this to work