0

Is there any way for a Google App Script to find out what the visible width in the current sheet is in a Google Spreadsheet? There doesn't appear to be, but I thought I'd see if anyone knew of one. I'm trying to rearrange/resize my columns to work nicely with devices of various sizes.

Is there anything you could add that would dynamically size to 100% and could be measured by GAS? Again, I couldn't find anything, but I thought I'd ask.

Rubén
  • 34,714
  • 9
  • 70
  • 166
Rebecca
  • 489
  • 1
  • 6
  • 11
  • 1
    Apps Script runs in Google's servers, not your browser (or mobile app), so in general terms, Apps Script has no idea if there is even a UI attached. In some specific instances you can access [`SpreadsheetApp.getUi()`](https://developers.google.com/apps-script/reference/base/ui) but as you state, there is no feedback available here. – tehhowch Jan 07 '19 at 15:11
  • I think this might [help](https://stackoverflow.com/a/8876069/7215091). – Cooper Jan 07 '19 at 18:01
  • You would need to open a dialog box with JavaScript in a ` – Alan Wells Jan 07 '19 at 19:14
  • A dialog box like I would get from function openDialog() { var html = HtmlService.createHtmlOutputFromFile('Index') .setSandboxMode(HtmlService.SandboxMode.IFRAME); SpreadsheetApp.getUi() // Or DocumentApp or FormApp. .showModalDialog(html, 'Dialog title'); } ? When I create that dialog box, it is contained in a 500px box, which I can measure with a script function, but that doesn't get me the width of the document. – Rebecca Jan 08 '19 at 16:03

0 Answers0