r/GoogleAppsScript • • Oct 17 '24

Question Adding new Tab to Google Doc with apps script?

Is there a way to add / create a new tab in a Google Doc with apps script?
I only found functions to retrieve and updata content of tabs.

6 Upvotes

17 comments sorted by

1

u/MrBeforeMyTime Oct 17 '24

Do you mean google sheets?

-1

u/skozzm Oct 17 '24

No, Google Docs. They now have Tabs
https://developers.google.com/docs/api/how-tos/tabs

1

u/MrBeforeMyTime Oct 17 '24

The more you know, thanks

1

u/dimudesigns Oct 19 '24 edited Oct 19 '24

When Google rolls out a new UI feature in Google Workspace, I've learned not expect an API or GAS analog to be available from jump.

A feature release roadmap for GAS isn't available but they offer release notes for GAS and release notes for the Google Docs API. So you can try checking those resources periodically for updates.

I don't know if Google has plans to implement tabs in the Google Docs API or GAS, but I suspect they'll first get some metrics on usage of the feature to see if it warrants that level of support. Hopefully, they'll implement it at some point.

EDIT: It looks like you might be able to manipulate tabs from the Google Docs API. Assuming that's the case then you can try using UrlFetchApp.fetch() from GAS to call the API directly, instead of using GAS's built-in Docs service.

2

u/skozzm Oct 21 '24

Thank you, the release notes were very helpful! I'll keep an eye on them.

And yes, tabs are now implemented in GAS, but there are no functions to create tabs in a document.

1

u/WicketTheQuerent Oct 27 '24

Don't forget the Advanced Documents Service.

3

u/West_Catch81 Nov 19 '24

Any update? Can I create a tab yet?

1

u/ShivKaushal Oct 17 '24

Pretty sure I got an email about them adding some tabs support a while back…

1

u/ShivKaushal Oct 17 '24 edited Oct 17 '24

This was it: https://developers.google.com/apps-script/guides/docs/tabs - no mention of creating tabs, which seems ridiculous

0

u/WicketTheQuerent Oct 17 '24

There is no way to add Document Tabs using Google Apps Script.

1

u/skozzm Oct 18 '24

Yeah, i was hoping this isnt the case. Thank you

0

u/[deleted] Oct 17 '24

[deleted]

1

u/skozzm Oct 18 '24

addTab isnt a function of documentApp class.  Got the same response from Perplexity But thank you.