Is it possible to access a file without opening it in Google Drive? - google-drive-api

So I currently have an add-on, it works fine. Something I am interested in doing is allowing the user to access the application without entering the document. I know this is possible with the Open With tab once a document is right-clicked but i don't want it sent away from the drive itself if that makes sense. Is there a way to bring up a sidebar within the drive itself once the Open With tab is selected? Or is there another way around this? I essentially just want the user to enter in data that will be assigned to the document but, currently as it's an add-on it only works on google docs files. Would it have to become an app?
Thanks everyone.

Related

Can't log in to Google Apps Scripts

I'm using multiple Google accounts. In one of them (not default) I created Google Spreadsheet file and I want to create Script connected to it. Nothing complicated. But the problem is that after clicking Tools > Script Editor I'm being redirected to default user or I see this screen:
The same problem I have when trying to use: script.google.com
What can I do to enable Script editor?
I know you asked this 9 months ago, but here is my solution;
Sign out of all google accounts except the owner of the spreadsheet
You can now access the scripts and macros pages (go there)
Create a bookmark of them (this saves which profile is logged in)
Now sign back into all your profiles
Voila!
You will be able to access the scripts or macros via the bookmarks without getting the error page.
This is a reported bug.
Go give it a ☆ if you want to let Google know that this affects you.
You can consider appending authuser=email to the URL to open the script with a specific Google account.
For example, script.google.com...?param=value&authuser=email#example.com
I was not able to reproduce the problem. Perhaps it's a glitch or there is something wrong that requires some troubleshooting techniques that are off-topic on this site.
As a workaround, for the account having problems, use another Google Chrome profile, Incognito mode, or another browser.
By the other hand, it's possible that there isn't any wrong and it's just something related to your specific scenario.
From Sign in to multiple accounts at once
Sometimes settings might carry over
If you're signed in to multiple accounts at the same time, sometimes we can't tell which
account you're using. For example, if you're signed in to two accounts
and you open a new browser window, we aren't sure which account you
want to use. In cases like these, Google might apply settings from
your default account, like its Web & App Activity and Ads
Personalization settings.
google's default account (the first one you sign on with) has to be the owner of the sheet
Based on #iansedano's answer, you can share the file with the default chrome user and open the same link in a new tab again to resolve the issue.
If someone needs a quick fix for this :
At the end of the url change the "authuser=1" by the index of the Google Account you want to log with. (0 is the first one, 1 is the second)
https://i.stack.imgur.com/qJows.png
You can also open a new incognito window, paste your sheet url there (you'll need to authenticate). Then you can open Tools -> Script Editor

Create shared Google Drive document owned by web service

I'm new to the Google APIs, and would like to write a small service class for my web application that:
creates blank Google document without user assistance
assigns a generated title
returns a URL that can be provided to multiple people to edit this document
This document mst be editable via a sharing link. Ideally it is owned/managed as part of the web service's Drive storage.
Code is welcome if it's easier than explaining, but I'm really asking for help understanding Google's service offering.
Can I fully authenticate using only credentials specific to my app? (e.g. call the Drive API without prompting an interloper/observer/user to
authenticate.)
Once authenticated, can I create documents local to my
API?
Whose quota are the created documents consuming, the person that created the API key?
Can I share
these created documents with others?
Will I be able to manage a list of
these created file URLs from a standard Google web UI?
Just to clarify what it is that you are asking. You want to be able to embed a google doc on your website A couple things that can happen here.
First, you will need to create a google doc, lets say a spreadsheet. Within that spreadsheet you will:
click File > Publish to the Web.
From here a new window will be brought up. Click Embed and Published content and settings and click the publish button. Ensure the Automatically republish when changes are made checkbox. (this will allow for your website to be automatically updated anytime that doc is changed.
Take the embedded link that is generated and plop it in your webpage and it will be live.
Now you can share the page via Google Docs and anyone that has that link can make changes to that spreadsheet. As soon as a change is made, it will update on your website with the next refresh.
Hope this is all clear, let me know if there is anything unclear.
Cheers

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.

Cannot find a Google App Script I deployed as a web app

How can I find a Google App Script web app I deployed and modify it? It does not appear in my drive. Perhaps I didn't save it. Does it persist or disappear eventually? Is there somewhere that list all deployed web apps? If so, I have been unable to find it.
If your webapp is recent, simply replace "exec" at the end of the url with "edit" (without quotes) and you'll get the script editor opened on your script.
(Very old webapp have a different structure but it changed quite a long time ago so I guess you're not concerned with that.)
No. There is nothing like deployed webapps list. if u didn't save, u can't get it back even though you had deployed it. Make a try to open that script with the url available in your browser's history.

Determine if a certain File is process by a project that uses Google Drive API

Good day! I am currently developing a website using Google Drive API. However, I am wondering if is it possible to know if a certain file is created/uploaded/shared by the project using an App Id. I was thinking if it is belong to the attributes of a file. But, when i checked, it seems that, there's no such thing.
What I am trying to do, is to filter the files' shared by the other user to the owner of the account using my web site. Is it possible? Any suggestions on how to do it?
Thank you in advance.
File metadata doesn't contain this information unfortunatelly, therefore you can't know if some file was created by your app or not. But FYI Google store it somewhere, if you will try to upload somefile without providing its content type (* / *) and after that try to open this file through browser you will see the message:
No preview available
This item was created with YourAppName, a Google Drive app.
Download this file or use one of the apps you have installed to open it.