Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion advanced/docs.gs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function insertAndStyleText(documentId, text) {
function readFirstParagraph(documentId) {
try {
// Get the document using document ID
const document = Docs.Documents.get({'includeTabsContent': true}, documentId);
const document = Docs.Documents.get(documentId, {'includeTabsContent': true});
const firstTab = document.tabs[0];
const bodyElements = firstTab.documentTab.body.content;
for (let i = 0; i < bodyElements.length; i++) {
Expand Down
11 changes: 2 additions & 9 deletions docs/quickstart/quickstart.gs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@
*/
function printDocTitle() {
const documentId = '195j9eDD3ccgjQRttHhJPymLJUCOUjs-jmwTrekvdjFE';
try {
// Get the document using document id
const doc = Docs.Documents.get({'includeTabsContent': true}, documentId);
// Log the title of document.
console.log('The title of the doc is: %s', doc.title);
} catch (err) {
// TODO (developer) - Handle exception from Docs API
console.log('Failed to found document with an error %s', err.message);
}
const doc = Docs.Documents.get(documentId, {'includeTabsContent': true});
console.log(`The title of the doc is: ${doc.title}`);
}
// [END docs_quickstart]
Loading