After searching, the closest information I've found is this question. However, that answer covers just creating a Google Drive file, period. I would like to find out how to make that file get created in a specific folder.
Is this possible?
Web Applications Stack Exchange is a question and answer site for power users of web applications. It only takes a minute to sign up.
Sign up to join this communityAfter searching, the closest information I've found is this question. However, that answer covers just creating a Google Drive file, period. I would like to find out how to make that file get created in a specific folder.
Is this possible?
I watched what happens when Google Docs creates a new document in a folder. The browser briefly goes to a create url. To make the url, you need to know your folder's id. If you navigate to the folder in a browser, its id is at the end of the url:
https://drive.google.com/drive/u/0/folders/[string_of_characters_is_the_folder_id]
Copy the id, open a new browser tab, and paste the id onto the end of the create url, like so:
https://docs.google.com/document/create?usp=drive_web&folder=[string_of_characters_is_the_folder_id]
Press Enter, and the browser will go to your new document created in the folder identified in the url.
I know this thread has been quiet for a while, but it helped me.
I was able to accomplish this by:
getting the URL of the destination folder https://drive.google.com/drive/folders/[Folder ID]
taking the file's url
/edit
with /copy
copyDestination
param to the endOriginal URL:
https://docs.google.com/[specific file URL]/edit
Final result would look like this:
https://docs.google.com/[specific file URL]/copy?copyDestination=[Folder ID]
I hope this helps!
To follow on to the questions in comments on the answer from @jaycer :
The URL would look like this
https://docs.google.com/document/d/${temlpateId}/copy?id=${temlpateId}©Collaborators=false©Comments=false&includeResolvedCommentsOnCopy=false&title=${title}©Destination=${folderId}&usp=docs_web
Substituting these values :
${temlpateId}
: The ID of the source file/template. You can get this from the URL when you browse to the source file/template. Note that the value shows up twice in the URL${title}
: The name to give the new file${folderId}
: The ID of the folder to put the new file in. This comes from the URL when you browse to the Google Drive folder.New Document: https://docs.google.com/document/create?usp=drive_web&folder=[folder-id]
New Spreadsheet: https://docs.google.com/spreadsheets/create?usp=drive_web&folder=[folder-id]
Hmm, i just thought: actually it should be fairly easy to create a script, so that you can make a google doc by just right clicking in windows explorer. Would be insanely helpful as an alternative, if you're not using word and don't want to use the browser all the time.